I want to make a script that makes a player's jump power or walk speed higher, but each player have a different name. I'm having difficulties to knowing the players name. Can someone make me a script and care to explain what each line means? I tried using this:
local JButton = game.Workspace.JButton JButton.ClickDetector.MouseClick:Connect(function(plr) game.Workspace.plr.Humanoid.JumpPower = 100 end)
P.S I am still pretty new to scripting
try this
local JButton = game.Workspace.JButton JButton.ClickDetector.MouseClick:Connect(function(plr) -- game.Workspace.plr.Humanoid.JumpPower = 100 -- Old code workspace[plr.Name].Humanoid.JumpPower = 100 -- New code end)
because you're getting the player's name index of Workspace. May I also point out you to use workspace
instead of game.Workspace
, as it is static and saves time.