Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

There's a thing wrong with incinerator my script ?

Asked by 4 years ago
local box = game.Workspace.BOX
local thing = script.Parent
thing.Touched:Connect(function(Touch)
     local Player = game.Players:GetPlayerFromCharacter(Touch.Parent)
print(Player)
if Player then
    if Player:FindFirstChild("BOX") ~= nil then
    Player:FindFirstChild("BOX"):Destroy()
    thing.Parent.Handle.Transparency = 0 
        print("Removed the players Item")
else 
    return
       end 
      end
end)

The BOX destroy and Handle Transparency thing doesn't work even thought the touch thing works PS : BOX is a tool and this is a server script

1 answer

Log in to vote
0
Answered by
Gojinhan 353 Moderation Voter
4 years ago
local box = game.Workspace.BOX
local thing = script.Parent
thing.Touched:Connect(function(Touch)
if game.Players:GetPlayerFromCharacter(Touch.Parent) then
    if Player:FindFirstChild("BOX") then -- could be wrong on this, but I'm pretty sure player:FindFirstChild isn't a bool value, regardless if you're trying to find it it's fine without making any changes.
    Player:FindFirstChild("BOX"):Destroy()
    thing.Parent.Handle.Transparency = 0 
        print("Removed the players Item")
else 
    return
       end 
      end
end)
Ad

Answer this question