i attempted to edit some giver script i found on youtube:
local item = game:GetService("ReplicatedStorage"):WaitForChild("Bloxy Cola")
local db = true
script.Parent.Touched:connect(function(part)
if part.Parent:FindFirstChild("Humanoid") ~= nil then
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if player ~= nil then
if player.Backpack ~= nil then
if db == true then
db = false
if part.Parent:FindFirstChild("Torso") then -- if the r6 torso exists give it to em
item:Clone().Parent = player.Backpack
else
part.Parent.UpperTorso.CFrame = CFrame.new(1.657, -0.052, 91.883)
wait(60) -- if it doesnt then teleport them to spawn
db = true
end
end
end
end
end)
I will replace the teleport with a new item to be given, but the code doesnt work entirely. what am i doing wrong here?

1 comment
What exactly is supposed to happen? What is the goal of this script? It's hard to fix your problem if you do not describe what is meant to occur.