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

My tool does not parent itself to Lighting. Any errors in my script?

Asked by 3 years ago
Edited 3 years ago
wait(0.1)
if script.Parent.Parent.Parent.Name == not "RazorXX2" then
    script.Parent.Parent = game.Lighting
end
wait(0.1)
script:Destroy()

Help! The script is not working, the tool is showing up for everyone. So the concept here is that if the name of the player is not "RazorXX2" then the tool will move to Lighting, but it is not working. Is there any error here? Oh, by the way this is a local script parented to a tool in the player's backpack.

0
IS it in a playerjoinedfunction? SirSuperScorpion 27 — 3y
0
why not using ~= so it only fires when its a false statement or if you bad then do == and put the code in else Xapelize 2658 — 3y
0
and where is it located, and it's a very bad script since you need playeradded function, not waits Xapelize 2658 — 3y
0
why did i not think of that lol RazorXX2 24 — 3y

2 answers

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
3 years ago
Edited 3 years ago

i think you meant for:

game:GetService("Players").PlayerAdded:Connect(function(player) -- Get player by doing this
    if player.Name == "RazorXX2" then -- If player name is RazorXX2
        game:GetService("Lighting").Tool:Clone().Parent = game:GetService("StarterPack") -- Made this because player respawn, the tool still exists
        game:GetService("Lighting").Tool:Clone().Parent = player.Backpack
    end
end)

Instead of detecting it's not RazorXX2, why not thinking detect if it's RazorXX2 and do the complete opposite

also, put your tool in Lighting, and name the Tool to the tool, and bhlah blahla blah

0
*gets tired of writing Xyternal 247 — 3y
0
sorry bro but my tool breaks when it clones RazorXX2 24 — 3y
0
wait lemme try to fix this again RazorXX2 24 — 3y
0
and also, playeradded does not work in local scripts RazorXX2 24 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

its ok now i fixed it. thx for the help

Answer this question