I’m certainly not a scripter like you, but I need your help, the fact is that I create a game in the likeness of a clicker, I tried all the guides myself, I wrote scripts, I used blanks from the toolbox, but works before, the local script saved the changed stats, but now it does it visually, I tried it create a script without local but it just doesn’t respond to any actions i need help if you know how to solve it then write here is the script i use thanks in advance!
–Script
local player = game.Players.LocalPlayer
local coins = player:WaitForChild(“leaderstats”):WaitForChild(“Coins”)
db = false
function clicked1()
if db == false then
local clickx = script.Parent.Parent.Parent.ClickX.Value
db = true
coins.Value = coins.Value + clickx print(“Added Coins!”)
wait(0.1)
db = false
end
end
Here is the script, Add a remote event in ReplicatedStorage called “Clicked”
local player = game.Players.LocalPlayer
local coins = player:WaitForChild(“leaderstats”):WaitForChild(“Coins”)
db = false
function clicked1()
if db == false then
local clickx = script.Parent.Parent.Parent.ClickX.Value
db = true
game.ReplicatedStorage.Clicked:FireServer(clickx.Value)
wait(0.1)
db = false
end
end
script.Parent.Parent.Click.MouseButton1Click:Connect(clicked1)
script.Parent.Parent.Click.TouchTap:Connect(clicked1)
Add a Server script in ServerScriptService
game.ReplicatedStorage.Clicked.OnServerEvent:Connect(function(Player, ClickxValue)
-- Give the Player Coins/Clicks now example down below.
Player.leaderstats.Coins.Value += ClickxValue
end)