So I am making a UI for my game that changes your Jump height for a trampoline. The problem is that my number value does change on their client side, but doesn’t for the server side.
I also tried using RemoteEvents
to get the players input from the TextBox but it still didn’t work. (The outputs always prints a 0)
I also changed the value from string
to a number using tonumber()
to see if that was the problem and it still didn’t work. Maybe there is a proper way around this, I never scripted in Studio for a while now because of school so help is appreciated.
1 Like
What does your scripts look like? Also, this is intentional behavior between client and server because of FE
You would need to make
local JumpGui
local RemoteEvent
JumpGui.FocusLost:Connect(function()
if not tonumber(JumpGui.Text) then return end --gotsa be a number
RemoteEvent:FireServer(tonumber(JumpGui.Text))
end)
and then serversided
local RemoteEvent
RemoteEvent.OnServerEvent:Connect(function(player, number)
player.Character.Humanoid.JumpHeight = number
end)
did you do something like that?
1 Like
Apologies for the long wait, I was cleaning my room.
Unfortunately I lost the client side script but that was listening for the buttons. I only have the server script
local applychange = script.Parent.ApplyChange
local resettodefault = script.Parent.ResetDefault
local p = script.Parent.Parent.Parent.Parent.Parent
local player = game.Workspace:FindFirstChild(p.Name)
local PlayerJumpHeight = player:WaitForChild("JumpPower")
applychange.OnServerEvent:Connect(function()
local number = script.Parent.ChangeNumber.Value
print(number)
PlayerJumpHeight.Value = number
end)
Alright, looking at your server script, do what @PostVivic recommended
The issue is that you need Parameters
put in parenthesis “player, value” then it will pass the value along aswell.
1 Like