local script inside of imagebutton inside screen gui:
local Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
if script.Parent == "rbxassetid://4888438200" then
DR.Value = DR.Value + 1
end
end)
local Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click = false if
Parent == "rbxassetid://4888438397"
leaderstats script in serverscriptservice:
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)

5 comments
Okay there are so many errors in here. You need to use an event, use rbxassetid:// for Ids, you need to define what DR is, do DR.Value = DR.Value + 1, and your entire if statement at line 9-10 is wrong
I added a remote event into the local script
DR is already explained in my leaderstats and I have now edited the script to your liking
You still can't address DR if the mouseButtonClick is outside of the playerAdded function
Can you put that into the script?