game.Players.PlayerAdded:Connect(function(plr)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = plr
local DP = Instance.new("IntValue")
DP.Name = "Points"
DP.Parent = stats
local DR = Instance.new("IntValue")
DR.Name = "Dice Rolls"
DR.Parent = stats
end)
local Player = game.Players.LocalPlayer
local DR = Instance.new("IntValue")
script.Parent.MouseButton1Click:Connect(function()
Player.leaderstats["Dice Rolls"].Value += 1
script.Parent.Visible = false
script.Parent.Parent.StClOnRB.Visible = true
wait(2.5)
script.Parent.Visible = true
script.Parent.Parent.StClOnRB.Visible = false
script.Parent.Parent.StClOnRB.Selectable = false
end)
What I want the script to do: Make leaderstats so it can add 1 to DR on click of its parent ImageButton.
What the script does: Keep it from being clicked over and over.
The Script is inside an ImageButton that is inside a ScreenGui inside StarterGui.

3 comments
wait, is this a server script or local? and where is it located
wait, is this a server script or local? and where is it located
it used to be a script but i changed it to a local script since you wnated to use a local script