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

How can I make it happens when the player clicks instead of equipping the tool?

Asked by 5 years ago

local Tool = script.Parent;

local shirt = game.ReplicatedStorage.Clothes.CurseMarkShirt:Clone()

Tool.Equipped:connect(function()

local player = script.Parent.Parent

player.SasukeClassicShirt:remove()

shirt.Parent = player

Tool.CurseMark.Parent = player.Head

end)

script.Parent.Unequipped:connect(function()

script.Parent:remove()

end)

0
hmmm, clear things up please? this is not even a question starmaq 1290 — 5y
0
there is a different event that happens whenever you click on it Dominus_ARA 24 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).
local Tool = script.Parent
local shirt = game.ReplicatedStorage.Clothes.CurseMarkShirt:Clone()
Tool.Activated:connect(function()
    local player = script.Parent.Parent
    player.SasukeClassicShirt:remove()
    shirt.Parent = player
    Tool.CurseMark.Parent = player.Head
end)
script.Parent.Activated:connect(function()
    --So you can remove it when you click again. 
    script.Parent:remove()
end)        
Ad

Answer this question