I'm trying to make a simulator game and there is a wall blocking another area which you need 100 cash to pass-through here is the script:
local rc = 100
local debounce = true
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player.leaderstats.Cash.Value >= rc then
if debounce then
debounce = false
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
if rc.Value <= rc then
script.Parent.Transparency = 0.15
script.Parent.CanCollide = true
end
end
end
end
end)
it says that rc doesn't have a value to change but it clearly does how do I fix this?
Ok so the problem is, RC isn't a VALUE it's a number, and you can see in your code
rc.Value
^ this is a code block by the way,
just remove the .Value and see if it works.