I’ve made a script for a simple action however it seems to not work; I am not nearly knowledgable enough to understand what may be wrong.
All help is appreciated :]
local bell = game.Workspace.bellmodel.Bell
bell.ClickDetector.MouseClick:Connect(function(click) Instance.new(“Animation”).AnimationId = “rbxassetid://”
if bell.Touched == true then click()
There are a lot of problem. First to detect when something touch the “bell” you must write : bell.Touched:Connect(function(hit) then enter
hey sorry i do actually have spaced between the lines however they didn’t show up in the block quote.
is this at all salvageable?
also, I’m sure you know this, the word I chose “click” is interchangeable with most anything
It’s okay. But you want that a animation play, right ? You maybe write the Id of the animation. Also do you want to play the animation after clicking or touching the “bell” ?
yeah, I was trying to make it so that a click-detector could let the player hit the bell and a short animation started, and once I’m not too lazy, a sound
also, the id is in the codeblock unless I’m misunderstanding?
So try to put this code :
local Bell = workspace.bellmodel.Bell
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://"
local Character = player.Character
if Character then
local Humanoid = Character:WaitForChild("Humanoid")
local Track = Humanoid.Animator:LoadAnimation(Animation)
ill be right back but first i want to make sure I understand this correctly.
this will start the animation when the action script function is set off by a player?
also what may be the point of the “local” things in the second function?
^ just making sure I can understand this lol :]
Yeah but we need to get the Character of the player and launch the animation with the humanoid.
uh the thing isnt working however it may be the clickdetector bc ur code seems to be functional, well form what I understand
Did you put the animation id ?
Actually I think I forgot but the mouse cursor wont change on the bell
welp i gave it a shot loll
ill send a screenshot of my clickdetector in the model just to see if that is the problem
the clickdetector in the game :]
Oh yeah it’s actually strange. You should try to put a hitbox or something like that and put the ClickDetector in the part.
will do :]
also ftr its 2:00 am by me so I might be a little slow
Oh it’s 7:59am here :] I’m little bit slow too.
ill keep it visible for now, Are any changes to the code needed?
Uh ok now you will put a clickDetector and inside the code you should put the name of the part.
sorry but wdym?
also the hitbox still wont show the cursor icon
+experimenting rn lol
Oh I mean you should put the clickDetector on the HitBox like that