So, I’m trying to make a pad that connects with a box. When it connects like touches together the box is suppose to disappear or something but it doesn’t work. Is there something wrong with the script?
script.Parent.Touched:Connect(function(Hit)
local player = game.Players:GetPlayerFromCharacter(Hit.Parent.Parent)
print(Hit.Parent.Name)
local char = Hit.Parent
if Hit.Name == ‘JobBox’ then
print(‘BOXHIT’)
script.Parent.Parent.Anim.Value = ‘false’
script.Parent.Parent.Taken.Value = ‘false’
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 20
Hit:Destroy()
Sure.
Here is another script btw. while(1)do
wait(1)
if script.Parent.Anim.Value == ‘true’ then
wait(10)
–workspace:FindFirstChild(script.Parent.Owner.Value).LeftHand.JobBox:Destroy()
script.Parent.Anim.Value = ‘false’
script.Parent.Taken.Value = ‘false’