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

Unable to cast string to bool, What?

Asked by
sameb556 -12
3 years ago
Edited 3 years ago

I'm making a game and I have ran into an error I don't understand Unable to cast string to bool

here's the script:

game.ReplicatedStorage.Remotes.BuyDance.OnServerInvoke = function(plr, Up, Down, Left, Right)

local animation = game.ReplicatedStorage.Animations:FindFirstChild(Up, Down, Left, Right)

if plr.leadersats.Points.Value >= animation.Price.Value then
    if not plr.playerValues.Animations:FindFirstChild(Up, Down, Left, Right) then
        plr.leaderstats.Points.Value -= animation.Price.Value

        local valUp = Instance.new('StringValue', plr.Animations)
        local valDown = Instance.new('StringValue', plr.Animations)
        local valLeft = Instance.new('StringValue', plr.Animations)
        local valRight = Instance.new('StringValue', plr.Animations)
        valUp.Name = Up
        valDown.Name = Down
        valLeft.Name = Left
        valRight.Name = Right

        plr.playerValues.UpAnimation = Up
        plr.playerValues.DownAnimation = Down
        plr.playerValues.LeftAnimation = Left
        plr.playerValues.RightAnimation = Right


        return 'Success'
    else
        plr.playerValues.UpAnimation = Up
        plr.playerValues.DownAnimation = Down
        plr.playerValues.LeftAnimation = Left
        plr.playerValues.RightAnimation = Right

        return 'Equip'
    end
else
    return 'Error'
end

end

0
Could you take a screenshot of the console? vonotige 49 — 3y
0
sure sameb556 -12 — 3y
0
I'm kind of new to this website could you tell me how sameb556 -12 — 3y
0
I would use a discord link but i also see people using imgur for screenshots. BulletproofVast 1033 — 3y
View all comments (7 more)
0
No, I need a screenshot of the developer console, not the script itself. vonotige 49 — 3y
0
there it is sameb556 -12 — 3y
0
What is the name of the script? Main_Server or LocalScript? vonotige 49 — 3y
0
Main_Server sameb556 -12 — 3y
0
This is the local script if you need it: https://i.imgur.com/Ot9kd7Q.png sameb556 -12 — 3y
0
I think what the error means is that your’re trying to change a bool value (true or false) to a string value (“text”) 1JBird1 64 — 3y

Answer this question