Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Player = game:GetService("Players").LocalPlayer
- Character = Player.Character
- Torso = Character["Torso"]
- Head = Character["Head"]
- RightArm = Character["Right Arm"]
- LeftArm = Character["Left Arm"]
- RightLeg = Character["Right Leg"]
- LeftLeg = Character["Left Leg"]
- BRICKC = BrickColor.new
- MRANDOM = math.random
- function CreateSound(ID, PARENT, VOLUME, PITCH)
- local NEWSOUND = nil
- coroutine.resume(coroutine.create(function()
- NEWSOUND = IT("Sound", PARENT)
- NEWSOUND.Volume = VOLUME
- NEWSOUND.Pitch = PITCH
- NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
- Swait()
- NEWSOUND:play()
- game:GetService("Debris"):AddItem(NEWSOUND, 10)
- end))
- return NEWSOUND
- end
- function goldify(hit)
- local GOLDNAMES = {"Gold","Shiny rock","Munz","$$"}
- hit.Anchored = false
- hit.CanCollide = true
- hit.Parent = workspace
- hit.Name = GOLDNAMES[MRANDOM(1,#GOLDNAMES)]
- hit.Material = "Glass"
- hit.BrickColor = BRICKC("White")
- if hit:FindFirstChildOfClass("SpecialMesh") then
- local mesh = hit:FindFirstChildOfClass("SpecialMesh")
- mesh.TextureId = ""
- end
- if hit:FindFirstChildOfClass("Decal") then
- local mesh = hit:FindFirstChildOfClass("Decal")
- mesh:remove()
- end
- if hit.ClassName == "MeshPart" then
- hit.TextureID = ""
- end
- if hit.ClassName == "UnionOperation" then
- hit.UsePartColor = true
- end
- end
- function turntogold(hit)
- if hit.Parent ~= Character then
- if hit.Parent ~= workspace then
- print("mine...")
- local body = hit.Parent:GetChildren()
- for part = 1, #body do
- local child = body[part]
- if child.ClassName == "Part" or child.ClassName == "MeshPart" or child.ClassName == "UnionOperation" then
- if child.Name == "Head" then
- CreateSound("972134931", child, 2, 1)
- end
- goldify(child)
- elseif child.ClassName == "Accessory" or child.ClassName == "Hat" then
- if child:FindFirstChild("Handle") then
- goldify(child.Handle)
- end
- end
- end
- else
- goldify(hit)
- end
- end
- end
- local hit = Torso.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- turntogold(hit)
- end
- end)
- local hit = RightArm.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- turntogold(hit)
- end
- end)
- local hit = LeftArm.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- turntogold(hit)
- end
- end)
- local hit = RightLeg.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- turntogold(hit)
- end
- end)
- local hit = LeftLeg.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- turntogold(hit)
- end
- end)
- local hit = Head.Touched:Connect(function(hit)
- if hit.Parent:FindFirstChild("Humanoid") then
- turntogold(hit)
- end
- end)
Add Comment
Please, Sign In to add comment