im making an horror game that is some sort fan game of fnaf, so i made 2 buttons(hide and unhide) hide teleports you under table and unhide teleports back to chair. both are textbuttons with localscripts(regular wont work) ive made that theres an hiding value, so if you are hiding its 1 and if not its 0. if its 0 you get a jumpscare. hide button supposed to change it to 1 but it only change it in client. if i try server it isnt changed. i would also like to get help with building and scripting heres script of hide
wait(1)
player = game.Players.LocalPlayer
button = script.Parent
local debounce = false
function helpme()
if not debounce then
debounce = true
LowerTorso = player.Character.LowerTorso
LowerTorso.CFrame = game.Workspace.teleporters.tele2.CFrame
workspace.telepart4.Value.Value = 1
end
end
button.MouseButton1Click:connect(helpme)
while true do wait()
debounce = false
wait(7.5)
end

8 comments
you're changing a value locally, so it will only change to the client from where it was changed, you'd have to change it from the server if you want it to change to the server, so just use a server script to change
but you need the local player, and also a gui to change it
that's why you need to use remote events
https://www.youtube.com/watch?v=4Dc_bri9mjs
https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events
i tried and it didnt work, can you atleast fix it with remote events?
Yeah you need to use remote events to make a change to the server from the client
but i dont know how