Log in to vote

Is this OnClicked right?

Asked by
neoG457 315 Moderation Voter
7 years ago
function onClicked(playerWhoClicked)

local Spiral ="Animation")
    Spiral.AnimationId = ""
local animTrack = po.Character.Humanoid:LoadAnimation(Spiral)



It should play once I click.

Is it a Tool or a Gui? woodengop 1134 — 7y
Neither its apart of a bigger script in starterpack neoG457 315 — 7y
Next time please Put a Better Desc. woodengop 1134 — 7y
Well, click detectors are only for base parts. Not for gui's for local scripts or anything. Please show us a screenshot of your explorer tab of something. EzraNehemiah_TF2 3552 — 7y

1 answer

Log in to vote
Answered by 7 years ago

First, you would need to put a ClickDetector in the part you want to click in order for this function to fire. (If it is a GUI, you need a TextButton)

If it isn't a part (Assuming it is a GUI), you need to do this as your connecting line:

TextBox's Location.MouseButton1Click:connect(onClicked)

Otherwise, if it is a part, you need to do this as your connecting line:

ClickDetector's Location.MouseClick:connect(onClicked)

NOTE: Replace (TextBox's Location) and (ClickDetector's Location) with their location (Pretty obvious LOL)

Its not a GUI or Part tbh. neoG457 315 — 7y

Answer this question