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

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