Hey, so basically I’ve been trying to practice my LeaderBoard scripting, and I wanted to ask if this way of giving points is safe from the tool is safe?
Precisely line 22-23?
local cookieTool = script.Parent
local handle = cookieTool:WaitForChild("Handle")
local bites = 0
local cookie2 = game:GetService("ServerStorage").Cookie2
local cookie3 = game:GetService("ServerStorage").Cookie3
--Function to change cookie size.
local function onActivated()
if bites == 0 then
bites = bites+1
cookieTool:WaitForChild("Handle"):Destroy()
local newCookie = cookie2:Clone()
newCookie.Parent = cookieTool
newCookie.Name = "Handle"
elseif bites == 1 then
bites = bites+1
cookieTool:WaitForChild("Handle"):Destroy()
local newCookie = cookie3:Clone()
newCookie.Parent = cookieTool
newCookie.Name = "Handle"
elseif bites == 2 then
local player = game.Players:GetPlayerFromCharacter(script.Parent.Parent) --Getting player from character
player.leaderstats.Cookies.Value = player.leaderstats.Cookies.Value + 1
cookieTool:Destroy()
end
end
cookieTool.Activated:Connect(onActivated)