I am a starter game developer and I am making a FPS game. How do I make a deploy button that appears every time a round starts, and once you click it it disappears and teleport you to the map, and when they die the button doesn’t come back, and have to wait until the next round and button appears again?
Sorry if I am making logical and English mistakes.
local button = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local GameStarted = game.Workspace:WaitForChild(“GameStarted”) – This is just a value you can make
if GameStarted == true then
button.Visible = true
else
button.Visible = false
end
Button.MouseButton1Clicked:Connect(function()
character:WaitForChild(“HumanoidRootPart”).CFrame =
mapSpawn.CFrame
end)
(This is just an idea)
1 Like
Is this supposed to be a localscript?
1 Like
Yes make it a local script because you only want all the code to only happen for the client.
1 Like