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)

3 comments
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.
Go back into play mode, and press F9 for output.. Error might be about calling PlayerGui when player is still loading.
Nope, that's what the wait(2) is for. There are no errors when I run the game.