hi,
i found bug inside my scripts sell script and shop script.
is anyone can tell me why is with bugs?
here is the scripts
shop script:
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local Rps = game.ReplicatedStorage
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Humanoid") ~= nil then
Rps.Events.Pads.ShopPad:FireClient(player)
end
end)
sell script:
local db = true
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local Rps = game.ReplicatedStorage
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Humanoid") ~= nil and player:WaitForChild("Data").WandsValue.Value >= 1 and db == true then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + player.Data.WandsV.Value
player.Data.WandsV.Value = 0
player.Data.WandsValue.Value = 0
db = false
wait(.5)
db = true
end
end)
here is the bugs:


thank you for the help.