#Script Correcting

20 messages · Page 1 of 1 (latest)

tame whale
#

Here's the script ```lua
--- Colisions

local interval = script.Parent.Parent.IntervalGUI
local btn = interval.PlayAgainBtn

if Obstacles.Touched = true then

interval.Enabled = true

wait(1)

if btn.MouseButton1Click:Connect(function) then
    
    Player.Position = (0.085, 0, 0.417, 0)
    
    wait(0.3)
    
    interval.Enabled = false
end

end

shy mason
#

Holy ..

tame whale
#

What I'm basically trying to do is when the Player collides/touches with a cloud a gui opens and when the btn is clicked the gui closes and the Player goes back to its start position.

tame whale
#

it doesnt make sense

#

sorta new in ifs mb

#

anyhelp?

shy mason
#

Wehn you are using if, you nedd "==" to compare

#

At line 87 you cant use a if like that with an event

#

And to set position you use Vector3, UDIm2 or CFrame

tame whale
#

but i dont believe parts of the script is correct

#

like Obstacles.Touched

#

will that help in my purpose

shy mason
#

omg... Now I see..

#

.Touched is an event, you cant use if on that...

#

part.Touched:Connect(functio(hit)
--code
end)

merry narwhal
#

@tame whale do you want it to entirely be in one localscript?

tame whale
tame whale