Here is the local script in StarterPack:
local mouse = game.Players.LocalPlayer:GetMouse()
local int = Instance.new("IntValue")
int = false
local player = game.Players.LocalPlayer
script.Parent.Activated:Connect(function(Target)
print(mouse.Target.Parent)
if mouse.Target.Parent == "Noob" then
int = true
end
if int == true then
game.ReplicatedStorage.RemoteEvent:FireServer()
end
end)
Here is the script in ServerScriptStorage:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
player:WaitForChild("leaderstats").Bux.Value = player:WaitForChild("leaderstats").Bux.Value + 100
end)
And here are the leaderstats:
game.Players.PlayerAdded:Connect(function(plr)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = plr
local Bux = Instance.new("IntValue")
Bux.Parent = stats
Bux.Name = "Bux"
Bux.Value = 0
end)

1 comment
Thanks!