When A Player Turns In A Fish For Cash The Fish Should Be Destroyed But It Deletes All The Tools
Video:
robloxapp-20210828-1441125.wmv (396.0 KB)
local sample = script:WaitForChild("Sample")
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local GiveCashEvent = game.ReplicatedStorage.Events.A11L12ALB3LA
local Player = game.Players.LocalPlayer
local Module = require(game.ReplicatedStorage.Modules.Fish)
local ToolName = Module.Fish.Koi.Name
script.Parent.Name = ToolName
sample.Parent = plr:WaitForChild("PlayerGui")
mouse.Move:Connect(function()
local t = mouse.Target
for _,blocks in pairs(workspace.Bricks:GetChildren()) do
if t == blocks then
sample.Adornee = blocks
sample.Color3 = Color3.new(0.160784, 0.686275, 0.176471)
mouse.Button1Down:Connect(function()
sample.Adornee = nil
script.Parent:Destroy()
local Amount = Module.Fish.Koi.SellAmount
GiveCashEvent:FireServer(Amount, nil)
end)
else
if (sample.Adornee == blocks) then
sample.Adornee = nil
end
end
end
end)
Couple things here, you should be deleting the fish on the server side so that it replicates back over, and you should not be listening to the Client for how much money the fix is and sending it.
Having an event open like this gives literal free reign to the exploiters who want to just give themselves any amount of money.
What If I Fire The Server With A Security Code
GiveCashEvent:FireServer(Amount, nil, A0H2WF98H2FR)
If Security Code == A0H2WF98H2FR then
end
And Ok
How is the client supposed to get that security code?
The server would be preprogrammed with it. However the exploiters can see everything on the Client side. They can just open your script and read the code and find the key.
Just have the client send the name of the fix, and on the server check the value of the fix, and if they player actually has it, then if they do, have the server remove the tool.
Thats exactly what Im saying, whats the point of a security key if the exploiter can just fake it.
1 Like
Hmm I Bet I Can Think Of A Way To Do This, Maybe A Random Number Gen That Puts It Into A StringValue
Don’t, the exploiters will always find a way to get the code and get around it. Anything you can think of.
Your source of truth should always be the server. Never listen to the Client for anything.
Just send the tool of the player to the server, and when the server gets the call, have the server read the value that the server sees in the tool for the sell price, and give it to the player, then have the server delete it. Obviously make sure the player actually has the tool though and isn’t just firing a remote.
Ok, I Will Use The Server For This!