If you want it unique to the player, you should add the value in the Backpack instead of StarterGear like @PANDASonNOOB said. Otherwise this value could change for everybody and not just individually for the player.
local UIS = game:GetService(âUserInputServiceâ)
ValueCounter = 0
char = script.Parent.Character
UIS.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
ClickCounter = ClickCounter + 1
ValueCounter = ValueCounter + 0.01
print(ClickCounter)
game.Players.LocalPlayer.PlayerGui.Clicks.Number.Text = ClickCounter
char:FindFirstChild("Ball").Value = ValueCounter
end
end)
Although why dont u just instead use an IntValue and put it in the player?
output has a problem
Players.ItzVasiPlayerScripts.LocalScript:11: attempt to index nil with âFindFirstChildâ
Can we see what your Explorer looks like?
sure it will take a while for the post to get approved
use a print statement and do âPrint(char)â, I think it might be because the player character isnât loaded yet making char nil or something
yea it says nil when printed so that might the problem
should i do an wait for child?
dont wait for child the character is not a child of player i dont think
actually try it althought I dont think itll work
yea it dosent work but now after i added the print line the output has changed saying this
attempt to index nil with âFindFirstChildâ
oh hey ez solve just add a wait() infront of everything
might not work but should work
AHA use player.CharacterAdded, do some research on it should work
wait() dosent work but i will try character added
specifically look at how they did this code here: Best way to Wait() for Character? - #18 by sas_rbx
it solved the error but it wont update the value
weird, send ur current code (also where did u put it, and oh wait OHHH)
bruh use a serverscript XDDD
server script?? in starterplayerscripts??
yea, theres nothing wrong with that (not to my knowlegde)
it wont do anything now
wait maybe im doing something wrong, serverscript is basic one right?