local DataStoreService = game:GetService("DataStoreService")
local tapsStore = DataStoreService:GetDataStore("Taps")
local starterGui = game:GetService("StarterGui")
local replicatedStorage = game:GetService("ReplicatedStorage")
local UpdateRebirthGui = replicatedStorage.UpdateRebirthGui
local event = Instance.new("RemoteEvent")
event.Name = "AddStats"
event.Parent = game.ReplicatedStorage
event.OnServerEvent:Connect(function(plr)
local taps = plr.leaderstats.Taps
taps.Value = taps.Value +1
end)
game.Players.PlayerAdded:Connect(function(plr)
--create leaderstats
local is = Instance.new("Folder")
is.Name = "leaderstats"
is.Parent = plr
local menu = Instance.new ("IntValue", is)
menu.Name = "Taps"
local taps = tapsStore:GetAsync("Player_"..plr.UserId)
local success, errormessage = pcall (function()
starterGui.TapGui.Frame.counter.Text = taps
end)
if success then
menu.Value = taps
else
warn(errormessage)
end
end)
The error is between line 13-15
