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

I have that two scripts are working good in studio,but not in game,help?

Asked by 5 years ago

FIltering is turned off (Its a single player game) and the scripts are normal scripts. It works really good in studio,but not the same in game (I tryied to convert them into a local script)

Script 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 

Script two

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 
0
First thing, turn FE back on, I'm pretty sure roblox disabled games that aren't FE, only friends of the creator should be able to play them now User#20388 0 — 5y
0
You can't do LocalPlayer in a script Vulkarin 581 — 5y
0
You should not be putting things into lighting. User#21908 42 — 5y

2 answers

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

Turn on filtering enabled. seriously.

Filtering enabled stops clients from communicating with the server in a malicious way. We don't want this. When you do turn it on learn RemoteEvents.

They are extremely useful when creating a game when it's FE. So yes, you're going to have to remake those scripts probably since you did it without FE. But turn filtering enabled on, learn remote events, even remote functions probably. And you'll be good.

Ad
Log in to vote
-2
Answered by 5 years ago

Try turning FE on.

Answer this question