okay so basically, im trying to make a secure sprint system, the FOV changes and it seems to act as a toggle as the output prints, but i dont know why player speed or jump height isnt changing. i feel like its a matter of a simple fix but im not 100% sure what
#Server Sided Sprint issue
1 messages · Page 1 of 1 (latest)
Should be a simple fix
I only read through quickly but on the server side, when you define playerSpeed and playerJump to the humanoid values, you think you are creating a shortcut to the humanoids walkSpeed or JumpHieght but you are actually just creating a number value
so when you alter your playerSpeed value, it doesnt change the walkspeed but instead, changes the number that you set the variable to be
- That might be a little confusing but TLDR; replace playerSpeed with Humanoid.WalkSpeed and the same for jumpheight
local CoolValues = {
['Value1'] = 5,
['Value2'] = 10,
['Value3'] = 23
}
local Value3_Variable = CoolValues.Value3
print(Value3_Variable) -- This will print Value3_Variable which will now be '23', successfully completing the goal.
-- However, if I wanted to change CoolValues' Value3, I can't change it through the variable. For example, If I did
Value3_Variable = 26 -- This will not change the Value3 in CoolValues. Only the variable will be changed.
print(Value3_Variable, CoolValues.Value3) -- Output for this will be (26, 23). Showing you how the variable changed but not the original output
CoolValues.Value3 = 26 -- this WILL change the actualy value of CoolValues.Value3 and will be accessible
** You are now Level 2! **
heres an example with a little more explanation on how changing variables VS changing references work
if you have any other questions please ask
i think i did that but i hasnt worked
actually,
i fixed it, the client script was a child of the server script so that i could add it to the character, but i guess i shouldve just put the script into starter character
idk what i did but it fixed it
maybe it has something to do with the waiting for child, idk