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