✓ Accepted answer
If that's on a local script, you wont be able to change other players walkspeed and jumppower, only yours, so there is no problem there.
If it's a server script (which doesnt seem to be, because you are using LocalPlayer) then you will have to use Remote Events or Remote Functions. Because events fired from these objects always have their first parameters set to be the player who fired the event, there is no way for players to hack it by choosing another target for the spell, as long as you do use that first variable.
Example:
--localscript
TextButton.MouseButton1Click:Connect(function() workspace.RemoteEvent:FireServer(game.Players.PLAYERNAME) end)
--serverscript
workspace.RemoteEvent.OnServerEvent:Connect(function(player) print(player.Name) end)
If you use this code you will see that even if you send a specific player as target to server, the server will print your name instead of the target (PLAYERNAME). If you do set a second parameter on the server, it will be that target you wrote cliend side:
--localscript
TextButton.MouseButton1Click:Connect(function() workspace.RemoteEvent:FireServer(game.Players.PLAYERNAME) end)
--serverscript
workspace.RemoteEvent.OnServerEvent:Connect(function(player,target) print(target.Name) end)
1 comment
Which spell?