At the end of the code I set the waitt variable to ‘false’ again, it should work again but it doesn’t.
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local playerId = player.UserId
if waitt == false then
print("cliked")
waitt = true
local success, honey = pcall(function()
return bee_data:GetAsync("honey" ..playerId)
end)
if honey == 1 then
local success, currentGold = pcall(function()
return bee_data:GetAsync("sıra" ..playerId)
end)
local location_part = workspace.Tycoon.Bir_Sira:WaitForChild("" ..currentGold)
local dropper = ServerStorage:WaitForChild("Dropper")
local clonedmodel = dropper:Clone()
wait(1)
clonedmodel.Parent = workspace
clonedmodel:PivotTo(location_part.CFrame)
if clonedmodel:PivotTo(location_part.CFrame) then
waitt = false
end
end
end
end)
Maybe try remove the if statement?
(also did some stuff so it should hopefully work)
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local playerId = player.UserId
if not waitt then --doing waitt==false is the same as "not wait"
print("cliked")
waitt = true
local success, honey = pcall(function()
return bee_data:GetAsync("honey" ..playerId)
end)
if honey == 1 and success then
local success1, currentGold = pcall(function()
return bee_data:GetAsync("sıra" ..playerId)
end)
local location_part = workspace.Tycoon.Bir_Sira:WaitForChild("" ..currentGold)
local dropper = ServerStorage:WaitForChild("Dropper")
local clonedmodel = dropper:Clone()
wait(1)
clonedmodel.Parent = workspace
clonedmodel:PivotTo(location_part.CFrame)
waitt = false
else
warn("something went wrong (very informative)")
end
end
end)
part.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local playerId = player.UserId
if waitt == false then
print("cliked wait false")
waitt = true
local success, honey = pcall(function()
return bee_data:GetAsync("honey" ..playerId)
end)
if honey == 1 then
local success, currentGold = pcall(function()
return bee_data:GetAsync("sıra" ..playerId)
end)
local location_part = workspace.Tycoon.Bir_Sira:WaitForChild("" ..currentGold)
local dropper = ServerStorage:WaitForChild("Dropper")
local clonedmodel = dropper:Clone()
wait(1)
clonedmodel.Parent = workspace
clonedmodel:PivotTo(location_part.CFrame)
waitt = false
end
end
end)