Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Problem with a forcefield appearing upon GUI Click? [SOLVED]

The script is supposed to teleport players to a brick on click, then make the gui non visible, then give them FF. The only thing not working is the FF.

lol silly me I forgot it's game.LocalPlayers.Player.Character, not game.LocalPlayers.Player

EDIT I pasted in the wrong code, sorry I still solved the problem tho

1 answer

Please put your code in lua block from this point on

I didn't even see anything in your code about a ForceField. Also, don't restate events.. just put all actions in one. And you had two of the same things..

wait() math.randomseed(tick()) 

local player = game.Players.LocalPlayer 

script.Parent.MouseButton1Click:connect(function() 
	player.Character:MoveTo(workspace['spawn'..math.random(5)].Position)
	script.Parent.Visible = false
	local f = Instance.new('ForceField',player.Character)
	coroutine.wrap(function() wait(7) f:Destroy() end)()
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.