I have seen lots of posts that say that a function inside another function is unorganized. Since I am an asker, I want to be able to have cleaner scripts so that I can ask for help.
This code (snicker) functions
Cyvicz(Civics) is my currency.
Code:
--Made by CamScripted, cleaned by [YourNameHere]
local staph = 0
coin = script.Parent
a = 0
local h = Instance.new("Hint", workspace);
local m = Instance.new("Message", workspace);
local spin = coroutine.wrap(function()
repeat
coin.Rotation = Vector3.new( 0, a, 0)
wait(.01)
a = a+3
until staph == 1
end)
local coinage = coroutine.wrap(function()
coin.Touched:connect(function()
for _,Player in pairs(game.Players:GetPlayers()) do
if Player:FindFirstChild("leaderstats") then
Player.leaderstats.Cyvicz.Value = Player.leaderstats.Cyvicz.Value + 10
coin.Parent = game.Lighting
break
end
end
end)
end)
spin()
coinage()

1 comment
I tried that before, it didn't work for me.