#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)
You can use a remote event to send the coins to the client
uhmm i dont understand alot bec someone tell me that this script work on server so u can check from local
but how ?
What you want to do?
** You are now Level 10! **
oh wit i changed this script
local workspaceservice = game:GetService("Workspace")
local coin1 = workspaceservice:WaitForChild("Coin1")
local coin = script.Parent
local touch = true
coin.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
coin.Position = Vector3.new(math.random(-10,10) , 20 , math.random(-10,10))
touch = false
task.wait(0.5)
touch = true
end
end
end)
detect when coin change using GetPropertyChangedSignal("Value") and see if this change from sesrver side or local side
he talks about the coin value in leadeboard i think
ok what should i do ?
Nothing
They cant abuse it
If a player has 50 coins, he sets them to 1000 on client, server will still see 50 and him buying something for 1000 won't work
yeah
Unless you validate purchases on client (which is so stupid) they cant do crap with it
if the script is on server side i think thats enough
yeah
okk ty alot guys
yw
but what if i do in local side (i know it is stupid) but just for knowledge
They can abuse it
Then if they change it that will works
yeah so every thing player can cheat on i put on server side right ?
using remote event
No
** You are now Level 15! **
but like any thing player cant cheat like fps then no need for remote evnet
oh why
It depends
Sometimes you dont need remotes
But yeah
Just place important stuff on sever
server*
yes i dont need remote if local side cheater cant do anything will affect game right ?
Local script is more for gui and player stuff
Everything that affects the game system must be in server side script
Like if i did fps gui screen show , then no need to remote event bec if player change his fps 1000 still his pc or mobile normal one
okk tysm
You mean an indicator?
You don't need to tell server your fps thats useless
local runservice = game:GetService("RunService")
local fps_number = 0
local number_wait = 0
local text = script.Parent
runservice.Heartbeat:Connect(function(deltatime)
number_wait +=deltatime
fps_number +=1
if number_wait >= 1 then
text.Text = "Your fps is: "..fps_number .."/S"
number_wait = 0
fps_number = 0
end
end)
yes so no need remote event
yeah
alr
😭
oh i still have 1 problem only 😦
why it prints to me every sec 60/s fps
local workspaceservice = game:GetService("Workspace")
local coin1 = workspaceservice:WaitForChild("Coin1")
local coin = script.Parent
local touch = true
coin.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
coin.Position = Vector3.new(math.random(-10,10) , 20 , math.random(-10,10))
touch = false
task.wait(0.5)
touch = true
end
end
end)local workspaceservice = game:GetService("Workspace")
local coin1 = workspaceservice:WaitForChild("Coin1")
local coin = script.Parent
local touch = true
coin.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
coin.Position = Vector3.new(math.random(-10,10) , 20 , math.random(-10,10))
touch = false
task.wait(0.5)
touch = true
end
end
end)
```why here sometimes i get 2 coins not 1