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

Works in studio, but not online?

Asked by 8 years ago

Everything works the way I want it to, but its not working in Play mode, any ideas? Also first question on this site. :L

wait(2)
db=1
Part = script.Parent
scren = game.Lighting.Player_Data.Gui.sp00kScreen:Clone()
plrgui = game.Players.LocalPlayer.PlayerGui

Chance = script.Parent.Parent:WaitForChild("Chance")
WinChance = script.Parent.Parent:WaitForChild("Sp00kChance")
IsVisible = script.Parent.Parent:WaitForChild("IsVisible")
SCP = script.Parent.Parent:WaitForChild("SCP0871")
face = SCP.BillboardGui.Frame.ImageLabel

sp00kchance = math.random(1,1)
w0nchance = math.random(1,1)
Chance.Value = sp00kchance
WinChance.Value = w0nchance

function fadein(Image)
for i = 1,0, -0.05 do
Image.ImageTransparency = i
wait()
end
end

Part.Touched:connect(function(part)
local humanoid = part.Parent:FindFirstChild("Humanoid") 
if humanoid ~= nil then
if Chance.Value == WinChance.Value then
if db==1 then
IsVisible.Value = true
db=2
fadein(face)
wait(10)
if humanoid.Health ~= 0 then
scren.Parent = plrgui
for i = 0,1, 0.05 do
face.ImageTransparency = i
wait()
end
end
IsVisible.Value = false
db=1
end
end
end 
end)
0
To be more specific, when I touch the part in studio the Billboard Gui will appear, but in Play more it doesn't even acknoledge it. DevelopmentStatus 0 — 8y
0
Go back into play mode, and press F9 for output.. Error might be about calling PlayerGui when player is still loading. Nickoakz 231 — 8y
0
Nope, that's what the wait(2) is for. There are no errors when I run the game. DevelopmentStatus 0 — 8y

Answer this question