Ad
Log in to vote
1

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

Asked by 4 months ago
Edited 4 months 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 — 4mo
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 1971 — 4mo
0
and where is it located, and it's a very bad script since you need playeradded function, not waits Xapelize 1971 — 4mo
0
why did i not think of that lol RazorXX2 12 — 4mo

2 answers

Log in to vote
0
Answered by
Xapelize 1971 Moderation Voter
4 months ago
Edited 4 months 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 192 — 4mo
0
sorry bro but my tool breaks when it clones RazorXX2 12 — 4mo
0
wait lemme try to fix this again RazorXX2 12 — 4mo
0
and also, playeradded does not work in local scripts RazorXX2 12 — 4mo
Ad
Log in to vote
0
Answered by 4 months ago

its ok now i fixed it. thx for the help

Answer this question