#anticheat

1 messages · Page 1 of 1 (latest)

summer sleet
#

This script on server side but i want to know when player get coins from local side then he kick

#
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)
next ermine
#

You can use a remote event to send the coins to the client

summer sleet
#

uhmm i dont understand alot bec someone tell me that this script work on server so u can check from local

#

but how ?

next ermine
#

What you want to do?

ionic glacierBOT
#

studio** You are now Level 10! **studio

summer sleet
#

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)
summer sleet
stable knot
#

Why

#

Its only visual

#

And exploiters can delete your anti cheat

next ermine
#

he talks about the coin value in leadeboard i think

summer sleet
#

ok what should i do ?

stable knot
#

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

next ermine
#

yeah

stable knot
#

Unless you validate purchases on client (which is so stupid) they cant do crap with it

next ermine
#

if the script is on server side i think thats enough

summer sleet
#

okk ty alot guys

next ermine
#

yw

summer sleet
#

but what if i do in local side (i know it is stupid) but just for knowledge

stable knot
#

They can abuse it

next ermine
#

Then if they change it that will works

stable knot
#

yeah

#

but you're doing it on server so you shouldn't worry

summer sleet
#

yeah so every thing player can cheat on i put on server side right ?

#

using remote event

stable knot
#

No

ionic glacierBOT
#

studio** You are now Level 15! **studio

summer sleet
#

but like any thing player cant cheat like fps then no need for remote evnet

summer sleet
stable knot
#

It depends

#

Sometimes you dont need remotes

#

But yeah

#

Just place important stuff on sever

#

server*

summer sleet
stable knot
#

It's complicated

#

Give an example

next ermine
#

Local script is more for gui and player stuff

#

Everything that affects the game system must be in server side script

summer sleet
#

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

stable knot
#

You don't need to tell server your fps thats useless

summer sleet
# stable knot You mean an indicator?
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)
summer sleet
stable knot
#

yeah

summer sleet
#

alr

stable knot
#

um

#

Thats not how fps works

summer sleet
#

oh i still have 1 problem only 😦

summer sleet
#
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