【问题标题】:script only working in Studio脚本仅在 Studio 中工作
【发布时间】:2018-10-02 14:39:00
【问题描述】:

//编辑:是的,我添加了第二个参数 GPE,如果不是 gpe,则返回 end,以防有人挑剔不必要的细节

另一个问题是它很长,但是如果您阅读它并发现有问题,请告诉我。我还把它作为 LocalScript 放在 Startpack 中。

local uis = game:GetService("UserInputService")
local torso = script.Parent.Parent.Character.Torso or script.Parent.Parent.Character.UpperTorso
local TweenService = game:GetService("TweenService")
local db = true

function move(x)
local velocity = Instance.new("BodyVelocity")
velocity.Velocity = torso.CFrame.lookVector*50
velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
velocity.Parent = x
end

uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.R and db then
db = false

local part = game:GetService("ReplicatedStorage").Union:Clone()
part.CFrame = torso.CFrame + torso.CFrame.lookVector*10
part.Parent = game.Workspace

local effect = game.ReplicatedStorage.Waterfall:Clone()
effect.CFrame = part.CFrame

local light = game:GetService("ReplicatedStorage").PointLight:Clone()
light.Parent = part

local weld = Instance.new("ManualWeld")
weld.Part0 = part
weld.Part1 = effect
weld.Parent = part
effect.Parent = part

local goal3 = {}
goal3.Size = Vector3.new(120,70,70)

local goal4 = {}
goal4.Size = goal3.Size

local tweenInfo = TweenInfo.new(2)

local tween3 = TweenService:Create(part, tweenInfo, goal3)
local tween4 = TweenService:Create(effect,tweenInfo, goal4)

tween3:Play(); tween4:Play()

game.Lighting.Blur.Enabled = true; game.Lighting.ColorCorrection.Enabled = true

move(part)
part.Anchored = false
effect.Anchored = false
move(effect)

local goal = {}
goal.Size = Vector3.new(30,7,7)
goal.Transparency = 0.4

local goal2 = {}
goal2.Size = goal.Size

local tweenInfo = TweenInfo.new(3)

local tween = TweenService:Create(part, tweenInfo, goal)
local tween2 = TweenService:Create(effect,tweenInfo, goal2)

tween:Play(); tween2:Play()

game:GetService("Debris"):AddItem(part,2)
game:GetService("Debris"):AddItem(effect,2)
wait(.5)
game.Lighting.Blur.Enabled = false; game.Lighting.ColorCorrection.Enabled = false
db = true

end
end)

事情很简单,当我发布游戏并玩它时它不起作用,但它只适用于 Roblox Studio。 它尚未启用过滤,并且仍然无法正常工作。我不太清楚。

【问题讨论】:

  • 顺便说一句,我知道我应该把补间放在一个函数中,但以后不做
  • 这就是我在工作室测试模式下的样子
  • 这是我的地方的链接,当你按 R 时你可以看到没有任何反应

标签: lua roblox


【解决方案1】:

已修复,哈哈,我只是将本地脚本从 starterpack 移动到 startercharacter :D

【讨论】:

  • 明显改变了躯干变量
猜你喜欢
  • 2013-08-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-10-19
  • 2023-01-27
  • 2020-10-25
  • 2016-01-01
  • 2015-10-29
相关资源
最近更新 更多