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

Workspace.Part.Script:12: attempt to index number with 'Value'?

Asked by 4 years ago

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?

1
Please use code block or we can't help you. Dovydas1118 1495 — 4y
0
what is code block ADAM6O00 4 — 4y
0
Code Block is the button that has the Lua symbol. Click it and then copy + paste your code in those ~~~~~~~~~~~~. Dovydas1118 1495 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
@GoreDemons , rc is a variable and not a value, you should've said that. Dovydas1118 1495 — 4y
0
@Dovydas1118 it's a number, not a number value, he's correct. VAHMPIN 277 — 4y
0
THANK YOU ADAM6O00 4 — 4y
Ad

Answer this question