i don't really know how to script, so i need help with collectible tokens.
here's collect script:
local db = true script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then if db == true then db = false local player = game.Players:GetPlayerFromCharacter(hit.Parent) script.parent.Transparency = 0 player.leaderstats.Strength.Value = player.leaderstats.Strength.Value + 100 script.parent.Transparency = 0.7 script.parent.BackDecal.Transparency = 0.7 script.parent.FrontDecal.Transparency = 0.7 wait(3) db = true script.parent.Transparency = 0 script.parent.BackDecal.Transparency = 0 script.parent.FrontDecal.Transparency = 0 end end end)
You're doing this on the Server, therefore any changes in that script all players will see. You need to make it so it's on the client side. You can do that via a Local Script and RemoteEvents.
First add a RemoteEvent into ReplicatedStorage. And because you're adding player stats, you'll need to do that server side, so you can add another script and putting it in ServerScriptService and also add another RemoteEvent and call it 'GiveStrengthOnTouch' or anything you want.
Then add this to you Server Script:
script.Parent.Touched:Connect(function(hit) local Character = hit.Parent local Player = game.Players:GetPlayerFromCharacter(Character) if Character:FindFirstChild("Humanoid") ~= nil then game.ReplicatedStorage.RemoteEvent:FireClient(Player) end end)
Local Script:
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(player) local db = true if db == true then db = false -- You will need to change these locations. script.parent.Transparency = 0 game.ReplicatedStorage.GiveStrengthOnTouch:FireServer() script.parent.BackDecal.Transparency = 0.7 script.parent.FrontDecal.Transparency = 0.7 wait(3) db = true script.parent.Transparency = 0 script.parent.BackDecal.Transparency = 0 script.parent.FrontDecal.Transparency = 0 end end)
Then the script to give the player the Strength:
game.ReplicatedStorage.GiveStrengthOnTouch.OnServerEvent:Connect(function(player) player.leaderstats.Strength.Value = player.leaderstats.Strength.Value + 100 end)
I do apologise if this does not work for you. I hope you get the idea of it anyway.