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