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

cannot access SetSprite of userdata<ScriptWrapper>?

Asked by 8 years ago

On Line 53 I get this Error: "cannot access SetSprite of userdata<ScriptWrapper>" How do I fix this?

encountertext = "Papyrus is Paping :D!" --Modify as necessary. It will only be read out in the action select screen.
nextwaves = {"bullettest_bouncy"}
wavetimer = 4.0
arenasize = {155, 130}

enemies = {
"Papyrus The Unpaping"}

enemypositions = {
{0, 0}
}

-- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
possible_attacks = {"bullettest_bouncy", "bullettest_chaserorb", "bullettest_touhou"}

function EncounterStarting()
    -- If you want to change the game state immediately, this is the place.
end

function EnemyDialogueStarting()
    -- Good location for setting monster dialogue depending on how the battle is going.
    enemies[1].SetVar('currentdialogue', {"NYEHEHE!"})
end

function EnemyDialogueEnding()
    -- Good location to fill the 'nextwaves' table with the attacks you want to have simultaneously.
    -- This example line below takes a random attack from 'possible_attacks'.
    nextwaves = { possible_attacks[math.random(#possible_attacks)] }
end

function DefenseEnding() --This built-in function fires after the defense round ends.
    encountertext = RandomEncounterText() --This built-in function gets a random encounter text from a random enemy.
end

function HandleSpare()
     State("ENEMYDIALOGUE")
end

function HandleItem(ItemID)
    BattleDialog({"Selected item " .. ItemID .. "."})
end
animationFrames = {"poseur", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"}
currentFrame = 1
animationTimer = 0

function Update()
    animationTimer = animationTimer + 1
    if(animationTimer% 15 == 0) then
        currentFrame = (currentFrame % (#animationFrames)) + 1
        enemies[1].SetSprite(animationFrames[currentFrame])
        animationTimer = 0
   end
end

1 answer

Log in to vote
0
Answered by
Validark 1580 Snack Break Moderation Voter
8 years ago

Neither SetSprite nor SetVar is a function or yieldfunction on the Roblox platform.

Further, enemies[1] is a string "Papyrus The Unpaping".

Next time you post a question on this site, please describe what you are trying to do, how the script is supposed to work, and relevant information about the Roblox objects involved. I can't help you any further if I don't even understand what you were going for.

Ad

Answer this question