Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make localscript change values both at server and client?

Asked by 4 years ago

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

0
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 starmaq 1290 — 4y
0
but you need the local player, and also a gui to change it starmaq 1290 — 4y
0
that's why you need to use remote events starmaq 1290 — 4y
View all comments (4 more)
0
i tried and it didnt work, can you atleast fix it with remote events? megahealth303 0 — 4y
0
Yeah you need to use remote events to make a change to the server from the client Sulu710 142 — 4y
0
but i dont know how megahealth303 0 — 4y

Answer this question