#anticheat
1 messages · Page 1 of 1 (latest)
local workspaceservice = game:GetService("Workspace")
local folder = workspaceservice:WaitForChild("Parts")
local replicatedstorgeservice = game:GetService("ReplicatedStorage")
local coin = replicatedstorgeservice:WaitForChild("Coin")
local runservice = game:GetService("RunService")
local wait_time = 0
local touch = true
local function clonecoin()
local newcoin = coin:Clone()
newcoin.Parent = folder
newcoin.Position = Vector3.new(math.random(-10,10) , 20 , math.random(-10,10))
end
runservice.Heartbeat:Connect(function(deltatime)
wait_time += deltatime
if wait_time >= 5 then
wait_time = 0
clonecoin()
end
end)
folder.ChildAdded:Connect(function()
for i , eachcoin in folder:GetChildren() do
eachcoin.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
local leaderstats = plr:WaitForChild("leaderstats")
local coins = leaderstats:WaitForChild("Coins")
if leaderstats and coins and touch then
coins.Value +=1
eachcoin.Position = Vector3.new(math.random(-10,10) , 20 , math.random(-10,10))
touch = false
task.wait(0.5)
touch = true
end
end
end)
end
end)
here scrpt of my coin, in future i will add more coins and copy and past this script to other coins, and i will only change the coin.Value each coin will give
but how i can put anticheat
you literally do not need anticheat if it's on the server
If it isn't on the server, then you have no idea what you're doing
its on the server
how i do when player get money from local he kick ?
you do not need an anticheat
ok
but when i put coin on local side (i know its dumb thing) then i should add remote event ?