Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

My Workspace.Part.Transparency ==0 Cash Script Isn't Working, Would You Please Help Me?

Asked by 5 months ago

I recently posted a similar script about a day ago and someone helped, but this script isn't working either and I can figure it out. I've experimented with it and can't figure it out. Please help, thank!

game.Players.PlayerAdded:Connect(function(player)
    local stats = Instance.new("Folder")
    stats.Name = 'leaderstats'
    stats.Parent = player
    local cash = Instance.new("IntValue")
    cash.Name = 'Cash'
    cash.Parent = stats
    local part = workspace.B
    while part.Transparency == 0 do
        wait(2)
        cash.Value = cash.Value + 25
    end
end)
1
How exactaly it don't works? Leamir 1205 — 5mo
0
Try this one my dude print("Cash Leaderboard Loaded") function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" -- Do not change this local cash = Instance.new("IntValue") cash.Name = "Cash" -- Name of Currency. cash.Value = 1000 -- Amount each player who enters, get. cash.Parent = stats stats.Parent = newPlayer end game.Players.ChildAdded xOmqZaxk -45 — 5mo

1 answer

Log in to vote
1
Answered by 5 months ago

Hey, I noticed a fairly simple issue with your script. When you're defining the local part, you must have an exact location, not just a simplified version. I redid the script and made a working version of the game here, with copying on. Or you can view the script as:

game.Players.PlayerAdded:Connect(function(player)
    local stats = Instance.new('Folder')
    stats.Name = 'leaderstats'
    stats.Parent = player
    local cash = Instance.new('IntValue')
    cash.Name = 'Cash'
    cash.Parent = stats
    local part = game.Workspace.B 
    while part.Transparency == 0 do
        wait(2)
        cash.Value = cash.Value + 25
    end
end)
0
You put local part = workspace.B, You must have it as local part = game.Workspace.B superawesome113 64 — 5mo
0
Sorry its taken me so long to get back to you, me and my family went on vacation. Anyway, I'm trying to make it so when another part is touched, It then gives cash. CodeInOther: Brick = script.Parent Brick.Touched:connect(function() script.Parent.CanCollide = false script.Parent.Transparency = 1 script.Parent.Parent.B.CanCollide = true script.Parent.Parent.B.Transparency = 0 print "10-4" end) Darkcraft10 20 — 5mo
Ad

Answer this question