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

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

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)

2 comments

1

How exactaly it don't works?

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

1 answer

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)

3 comments

0

You put local part = workspace.B, You must have it as local part = game.Workspace.B

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)

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