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

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

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

0
Please format your script by clicking the Lua button. LazokkYT 117 — 4y
0
How ADAM6O00 4 — 4y

1 answer

Log in to vote
0
Answered by
Lyphios 77
4 years ago

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.

Ad

Answer this question