Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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?

3 comments

1

Please use code block or we can't help you.

0

what is code block

0

Code Block is the button that has the Lua symbol. Click it and then copy + paste your code in those ~~~~~~~~~~~~.

1 answer

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.

3 comments

0

@GoreDemons , rc is a variable and not a value, you should've said that.

0

@Dovydas1118 it's a number, not a number value, he's correct.

0

THANK YOU

This discussion is preserved as it was. New answers, comments, and votes are closed.