Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Made by Tweakified, Neonblox Games
- YouTube Tutorial: https://youtu.be/RM6v_fQKx9w
- Discord Support: https://discord.com/invite/JdaFf7p
- Server Script: https://pastebin.com/kP0PpT74
- Script Type: LocalScript
- Script Parent: StarterPlayer > StarterPlayerScripts
- --]]
- local TweenService = game:GetService("TweenService")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- local GetCoin = ReplicatedStorage:WaitForChild("GetCoin")
- local CoinPickupEffect = workspace:WaitForChild("CoinPickupEffect")
- local CoinsFolder = workspace:WaitForChild("Coins")
- local CoinTween1Info = TweenInfo.new(0.2)
- local CoinTween2Info = TweenInfo.new(0.2)
- local CoinTween3Info = TweenInfo.new(0.35)
- local CoinRotationTweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear)
- local RotationTweens = {}
- GetCoin.OnClientEvent:Connect(function(Coin)
- local OldRotationTween = RotationTweens[Coin.Name]
- if OldRotationTween ~= nil then
- OldRotationTween:Cancel()
- end
- local TempTween1 = TweenService:Create(Coin, CoinTween1Info, {CFrame = (Coin.CFrame + Vector3.new(0, 5, 0)) * CFrame.Angles(math.rad(120), 0, 0)})
- local TempTween2 = TweenService:Create(Coin, CoinTween2Info, {CFrame = (Coin.CFrame + Vector3.new(0, 10, 0)) * CFrame.Angles(math.rad(240), 0, 0)})
- local TempTween3 = TweenService:Create(Coin, CoinTween3Info, {CFrame = (Coin.CFrame + Vector3.new(0, 15, 0)) * CFrame.Angles(math.rad(360), 0, 0)})
- CoinPickupEffect:Play()
- TempTween1:Play()
- TempTween1.Completed:Wait()
- TempTween2:Play()
- TempTween2.Completed:Wait()
- TempTween3:Play()
- spawn(function()
- while Coin.Transparency < 1 do
- wait(0)
- Coin.Transparency = Coin.Transparency + 0.1
- end
- end)
- Coin:Destroy()
- end)
- repeat wait(0.1) until player:FindFirstChild("coindata") ~= nil
- local CoinData = player:FindFirstChild("coindata")
- for _, Coin in pairs(CoinsFolder:GetChildren()) do
- spawn(function()
- local CollectedCoin = CoinData:WaitForChild(Coin.Name)
- local TempTween1 = TweenService:Create(Coin, CoinRotationTweenInfo, {CFrame = Coin.CFrame * CFrame.Angles(math.rad(120), 0, 0)})
- local TempTween2 = TweenService:Create(Coin, CoinRotationTweenInfo, {CFrame = Coin.CFrame * CFrame.Angles(math.rad(240), 0, 0)})
- local TempTween3 = TweenService:Create(Coin, CoinRotationTweenInfo, {CFrame = Coin.CFrame * CFrame.Angles(math.rad(360), 0, 0)})
- while CollectedCoin.Value == false do
- TempTween1:Play()
- RotationTweens[Coin.Name] = TempTween1
- TempTween1.Completed:Wait()
- if CollectedCoin.Value == false then
- TempTween2:Play()
- RotationTweens[Coin.Name] = TempTween2
- TempTween2.Completed:Wait()
- if CollectedCoin.Value == false then
- TempTween3:Play()
- RotationTweens[Coin.Name] = TempTween3
- TempTween3.Completed:Wait()
- end
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement