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

Why can't I destroy the tool? [Solved]

Asked by 6 years ago
Edited 6 years ago

A hair appears on the head when this is equipped and at the same time the tool should vanish, but it doesn't. Why? I've tried going through the backpack, but when it's equipped, there is nothing in the backpack, then it's in the workspace with the player itself, even when I check in the workspace and in the player, it is there, but the output says that it's a nil value.

The tool is called "BigAfro" and the hair in the serverstorage is called so, but it doesn't interfere with my script, because it is cloned into workspace.


local Player = script.Parent.Parent.Parent local Mouse = Player:GetMouse() local character = Player.Character local PlayerHead = character.Head script.Parent.Equipped:connect(function(mouse) print("A tool was equipped") local hair = game.ServerStorage.BigAfro local clonehair = hair:Clone() clonehair.Parent = workspace clonehair.Position = character.Head.Position weld = Instance.new("Weld", clonehair) weld.Part0 = character.Head weld.Part1 = clonehair weld.C0 = CFrame.new(0,0,0) wait(0.1) Hair = Player.BigAfro Hair:Destroy() end)
0
So you want the tool to disappear after it's equipped? T1mes 230 — 6y
0
Yes. Krolaer 6 — 6y
0
Did you try putting script.Parent:Destroy()  ? T1mes 230 — 6y
0
I've missed that option, thank you - it worked. Krolaer 6 — 6y

Answer this question