Forget it (Close Topic)

Please watch your post bumping. (Posting over and over without keeping all of the words you say in one post.) Anyway, this is the “animation” part of the code.

function onActivated()
	if sp.Enabled and not sp.Taunting.Value then
		sp.Enabled = false
		local character = sp.Parent;
		local humanoid = character.Humanoid
		if humanoid == nil then
			print("Humanoid not found")
		sp.Handle.Trail.Enabled = true
		local		newanim = anims[math.random(1,#anims)]
		while newanim == sp.RunAnim.Value do
			newanim = anims[math.random(1,#anims)]
		sp.RunAnim.Value = newanim
		if newanim == "OverHeadSwing" then
			damage = swingdamage
			damage = slashdamage
		sp.Handle.Trail.Enabled = false
		damage = basedamage
		sp.Enabled = true

by load i mean this

--if your using that script you would do:
local animation = humanoid:LoadAnimation(newAnim)

Are you sure there is not a function connected to sp that detects a change in value

--in this line
sp.RunAnim.Value = newanim
--check if there is anywhere in the code that has this:

anyways i have told you how  to load and play animations
and i'm sure i am correct i have many animations in a project
im working on and thats how you do it.]]--

I don’t know. Check the code posted way above.

I did and I am telling you no actual animation is being played can you atleast try what i said to do.

If you are just going to reject people’s suggestions without trying, don’t post. This thread already lacks enough information as it is. Please read the category guidelines for more information and details on what should be included in a help request.

Dumping an entire script here, especially if it isn’t yours, and saying it doesn’t work isn’t sufficient enough for a thread in this category.

1 Like

Flag your own post under “Something Else” and ask for it to be deleted, or update your thread with actual information to work off of. Such can include (but is not limited to):

  • Console errors
  • Code hierarchy
  • Animation setup
  • Owner info (where its being uploaded and/or used at)

Please also use the reply button on a post rather than at the bottom. People can’t see when you reply so they don’t get notifications and have to constantly come back to see if there’s a reply to what they said or not.

It at least says this in the Output.image

Unflag it. He’s right in what he says.

Interpret this as a literal error. The object RunAnim isn’t a descendant of StringValue (whatever StringValue is). This is something that can be resolved if you put some time into debugging your code. Please address code issues what you can by yourself first before posting a thread.

It’d be worth investing into the concepts of writing in (Roblox) Lua to help you with this in the future.

1 Like

I can’t invest in concepts like that, unfortunately.

that saying you tried to index something thats not a property of a string value, try clicking on that error to go to line in the script with that error

Yes you can. Take some time to read up on the Developer Hub or learn coding. Investing enough time into writing in Lua is valuable and worth doing if you’re interested in developing on the platform, rather than relying on the forums to support you for every small problem (despite the category’s summary).

Oh, I thought you meant investing MONEY, I’m like “that’s crazy”, no, you meant TIME. Time is kind of the one thing I don’t have too much of. But I have…just enough. Anyway, I think I may or may not be able to invest time into concepts of Lua if I wanted to.

You can its really not that difficult once you get the gist of it and you can always ask questions here and tons of people are willing and able to help

If you want to get started learning Lua there are a handful of good resources.

The Roblox developer resources has a lot of topics on it,
The official manual is probably good for rinsing out any doubts,
And conducting generic searches on a search engine of your choice or even YouTube sometimes can come back with tutorials for things you may still have doubts about.

What you should do if you want to have working code:

  • Spend some time learning the language.
  • Get familiar with the Roblox api.
  • Practice and try to understand others’ code to further reinforce your own knowledge.
  • Keep practicing because it builds up with time.

You should avoid posting vague topics on code, especially when you don’t describe what you think is going wrong, and what you’ve already tried. It’s generally easier to help someone who already has basic understanding, but you shouldn’t just throw code out and expect people to debug and fix it for you completely.


If you’re needing to learn Lua, I really recommend this video:

It shows everything there’s to Lua & how to use them.

I know it says you want the topic to be closed, but I need to know, is the animation priority at ‘action’? If not, other animations will just override it.

1 Like