Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Something wrong in the script,working in studio but not in roblox game,someone knows what happen??

Asked by 6 years ago

There are 2 scripts not working in game.

First one

while true do 
wait(1)
script.Parent.HumanoidRootPart.Steps:Stop()
script.Parent.Base.PointLight.Range = 0 
script.Parent.Base.PointLight2.Range = 0
script.Parent.Humanoid.WalkSpeed = 9 
script.Parent.V.Value = 1
local Player = game:GetService("Players").LocalPlayer
local stats = Player:WaitForChild("stats")
local Light = Player.stats.Light
if script.Parent.V.Value == 1 and Light.Value == 1 then
    script.Parent.Base.PointLight2.Range = 18
    script.Parent.Humanoid.WalkSpeed = 30
else
end
wait(math.random(7 ,10)) 
script.Parent.V.Value = 0
script.Parent.Base.PointLight.Range = 18
script.Parent.Humanoid.WalkSpeed = 25
wait (0.5)
if Light.Value == 1 then
    script.Parent.HumanoidRootPart.Anchored = true
    script.Parent.HumanoidRootPart.Scream:Play()
wait (2)
script.Parent.HumanoidRootPart.Anchored = false
script.Parent.Humanoid.WalkSpeed = 9
script.Parent.Base.PointLight.Range = 0
script.Parent.V.Value = 1
wait (5)
end

end 

Second one

local Player = game:GetService("Players").LocalPlayer
local stats = Player:WaitForChild("stats")
local Light = Player.stats.Light
while true do
if script.Parent.V.Value == 1 and Light.Value == 1 then
    script.Parent.Base.PointLight1.Range = 0
    script.Parent.Base.PointLight2.Range = 18
    script.Parent.Humanoid.WalkSpeed = 30
    local script2 = script.Parent.Script2 .
    script2.Parent = game.Lighting
wait (9) 
   script.Parent.Base.PointLight2.Range = 0
 script.Parent.Base.PointLight1.Range = 0
    script.Parent.Humanoid.WalkSpeed = 9
script2.Parent = script.Parent 

end 

3 answers

Log in to vote
0
Answered by 6 years ago

Not very hard. Just put them into a LocalScript. That is probably the problem if the script is working in studio but not in the game.

0
Just put them into a LocalScript. ew_girl21 2 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Log in to vote
0
Answered by 6 years ago

Put those not-working scripts into LocalScripts since FE runs only Local Scripts inside StarterGui. Hopefuly this will fix your problem!

Answer this question