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

When clicked it won't give the sword, why?

Asked by 9 years ago
function onClicked()
    local playerStarterPack=workspace.open.gear.LinkedSword
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

Log in to vote
0
Answered by 9 years ago

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.

Ad

Answer this question