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

How do I get Its Value Then It Doesnt Give Me An Error And Nor Does It Work?

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 <= 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?

2 comments

0

Please format your script by clicking the Lua button.

0

How

1 answer

✓ Accepted answer

try something like this:

local Player = game.PLayers.LocalPlayer
local Character = Player.CharacterAdded:Wait()

if Player.leaderstats.Cash.Value = 100 then
--rest of code that allows the player to pass through
end

I didn't write the rest of the script because a) this is basically half a request and b)I'm not sure what your format is.

anyway you can work on the rest but this is basically what it's like, and change leaderstats to whatever your leaderboard stat is called in the Player.

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