Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweeningSerive = game:GetService("TweenService")
- local tweeninfo = TweenInfo.new(1)
- local item = workspace.Part
- local goal = {}
- goal.Color = Color3.fromRGB(102, 255, 0) -- Green
- goal.Size = Vector3.new(16, 4, 8)
- local goal2 = {}
- goal2.Color = Color3.fromRGB(255, 140, 0) -- Orange
- goal.Size = Vector3.new(8, 2, 4)
- local goal3 = {}
- goal3.Color = Color3.fromRGB(255, 0, 0) -- Red
- goal.Size = Vector3.new(4, 1, 2)
- local tween1 = TweeningSerive:Create(item, tweeninfo, goal)
- local tween2 = TweeningSerive:Create(item, tweeninfo, goal2)
- local tween3 = TweeningSerive:Create(item, tweeninfo, goal3)
- game.Players.PlayerAdded:Connect(function(Player)
- Player.CharacterAdded:Connect(function(Character)
- while wait() do
- local Magnitude = workspace.Part.Position.X - Character.HumanoidRootPart.Position.X
- if Magnitude > -10 then
- print("The player is near part!")
- tween1:Play()
- elseif Magnitude > -15 then
- print("The player is near part but far!")
- tween2:Play()
- else
- print("The player is not near part!")
- tween3:Play()
- end
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement