function onClicked()
local playerStarterPack=workspace.open.gear.LinkedSword
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
✓ ANSWER ACCEPTED
When clicked it won't give the sword, why?
1 answer
✓ Accepted answer
I'll explain what each line does by commenting!
script.Parent.ClickDetector.MouseClick:connect(function(onClicked)
print(OnClick.Name)--Using the Parameter(OnClick) to get the name of the player who clicked to set off the event
local LinkedSword = game. --Please add in the location of the "LinkedSword"
LinkedSword.Parent = game.Workspace[OnClicked.Name]--This sets the Parent of the "LinkedSword" to the Player's character.
end)
If you want anymore information about Parameter or anythings I wrote down,please feel free to post any question below.
This discussion is preserved as it was. New answers, comments, and votes are closed.
