yee me dumb and a bad scripter so i have this script and i want it to have every player in the game be affected by it local currentValue = player.PlayerStats.CurrentValue;
currentValue.Changed:Connect(function(newValue)
if (newValue >= 20) then
player.Character.Humanoid.JumpPower = 100;
end
end); how do i do that so with the player part like local player = ? what do i do
Hello there dear user,
This question is quite simple to answer, but I'll give you both Server Side and Client Side answers!
Client Side:
local plr = game.Players.LocalPlayer local char repeat wait() until plr.Character ~= nil char = plr.Character -- character is now not nil -- now you can do anything you want!
Server Side
local Players = game:GetService('Players') local AddedEvent = Players.PlayerAdded local Func1 = AddedEvent:Connect(function(plr) -- identify it as func1 so you can :Disconnect it! wait(0.1) -- useful ( do not remove ) local char plr.CharacterAdded:Connect(function(newchar) char = newchar -- new character -- new character declaration SAME CODE HERE end) char = plr.Character -- do anything to the character UNDER THIS LINE end)
Now that you understand the Basics of what this is, you can now continue doing what you enjoy.