i cant change a numbervalue that is stored in a tool in StarterPack with a script that is stored in StarterGui, how do i do that?
Well the issue is probs that the script is a local script. You can only change the things inside of the StarterPack server side if I am not mistaken due to it being what you get when you join so Roblox does not want exploiters to be able to change this.
You could use a remote event to fire to the client or somthing.
well the problem is that each player needs to have their own value
So then you should be using changing the number value in the Backpack/StarterGear.
local Backpack = game.Players.LocalPlayer.Backpack
local StarterGear = game.Players.LocalPlayer.StarterGear
i dont think it will work
the value changes constantly in the game its a clicker game where you spam clicks and each time you do
the power of a ball that will throw increases
Why do you have a script in StarterGui?
ServerScriptService is much more preferable to store server scripts in.
so it can show you the number of clicks that you pressed
make it a serverscript and put it in starterplayerscript or something
the value needs to be unique for each player
thats why I said put it in starterplayerscript, then just use something with getting the backpack from the player (which is script.parent), im not sure if the backpack is under Players.player or under Workspace.Character, I think its under Players.player, but if its under Workspace.Character just use GetCharacterFromPlayer() instead
too lazy to check where it is lol
also dont change the value of the tool in the starterpack or else everyone who resets will get that value lol
btw @Herbz_Dev2106 pretty sure thats not what they meant
From context, I believe they simply want a unique variable for each player, say I clicked my tool 5 times, giving me 5 clicks, YOU shouldn’t get 5 clicks as well, and say you click your tool 10 times, I would still only have 5 clicks, I think thats what they meant
yes thats what i meant but the problem is when i do that i get an error saying that Backpack is not a valid member of the local player
Do you have a script, at which you have tried to solve this problem, so we can get a better idea?
alr fine ill not be lazy and check on studios, gimme a sec
studios is not cooperating, this might take a while
yes i tried sending it but its in waiting approval
the script is this
local UIS = game:GetService(“UserInputService”)
ValueCounter = 0
PlValue = game.Players.LocalPlayer.Backpack.Ball.Value
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
PlValue.Value = ValueCounter
end
end)
ClickCounter = 0
thank you so much for helping me!!
I see the problem: When you equipt a gear, the gear goes under the player CHARACTER instead of the inventory, so instead you would want to use “GetPlayerFromCharater” and get the player, then use something like char:FindFirstChild(“tool”) or something
uhh its my first using something like this, can you send me a template please?