Hello,
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 :]
Block Code:
local bell = game.Workspace.bellmodel.Bell
bell.ClickDetector.MouseClick:Connect(function(click) Instance.new(“Animation”).AnimationId = “rbxassetid://”
end
)
if bell.Touched == true then click()
end
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?
local Bell = workspace.bellmodel.Bell
local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://"
Bell.ClickDetector.MouseClick:Connect(function(player)
local Character = player.Character
if Character then
local Humanoid = Character:WaitForChild("Humanoid")
local Track = Humanoid.Animator:LoadAnimation(Animation)
Track:Play()
end
end)
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?