Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This works in FE, tested via Roblox Studio's "Test" tab.
- local speed = 92
- local equipped
- local plr = game:GetService("Players").LocalPlayer
- local plrchar = plr.Character or plr.CharacterAdded:Wait()
- local tool = Instance.new("Tool", plr:WaitForChild("Backpack"))
- tool.Name = "RaceCar"
- local handle = Instance.new("Part", tool)
- handle.Name = "Handle"
- handle.CanCollide = true
- handle.Anchored = false
- local mesh = Instance.new("SpecialMesh", handle)
- mesh.MeshId = "http://www.roblox.com/asset/?id=264666411"
- mesh.TextureId = "http://www.roblox.com/asset/?id=264326115"
- mesh.Scale = Vector3.new(3, 3, 3)
- local gui = Instance.new("ScreenGui", plr:WaitForChild("PlayerGui"))
- gui.Name = "RaceCarGUI"
- local frame = Instance.new("Frame", gui)
- frame.Size = UDim2.new(1, 0, .3, 0)
- frame.Position = UDim2.new(0, 0, .7, 0)
- frame.BackgroundTransparency = .5
- frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- frame.BorderSizePixel = 0
- local SetSpeed_label = Instance.new("TextLabel", frame)
- SetSpeed_label.Name = "SetSpeed_label"
- SetSpeed_label.BorderSizePixel = 0
- SetSpeed_label.Size = UDim2.new(1, 0, .25, 0)
- SetSpeed_label.Font = Enum.Font.Arcade
- SetSpeed_label.Text = "Set Speed"
- SetSpeed_label.TextSize = 30
- SetSpeed_label.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- local SetSpeed = Instance.new("TextBox", frame)
- SetSpeed.BackgroundTransparency = 1
- SetSpeed.BorderSizePixel = 0
- SetSpeed.Position = UDim2.new(0, 0, .25, 0)
- SetSpeed.Size = UDim2.new(1, 0, .75, 0)
- SetSpeed.Font = Enum.Font.SourceSansLight
- SetSpeed.PlaceholderColor3 = Color3.fromRGB(48, 178, 96)
- SetSpeed.PlaceholderText = "Speed in studs"
- SetSpeed.Text = ""
- SetSpeed.TextScaled = true
- local prevSpeed = plrchar:WaitForChild("Humanoid").WalkSpeed
- local prevJumpPower = plrchar:WaitForChild("Humanoid").JumpPower
- tool.Equipped:Connect(function()
- prevSpeed = plrchar:WaitForChild("Humanoid").WalkSpeed
- prevJumpPower = plrchar:WaitForChild("Humanoid").JumpPower
- -- In case the player has set another speed
- plrchar:WaitForChild("Humanoid").WalkSpeed = speed
- plrchar:WaitForChild("Humanoid").JumpPower = 1
- equipped = true
- end)
- tool.Unequipped:Connect(function()
- plrchar:WaitForChild("Humanoid").WalkSpeed = prevSpeed
- plrchar:WaitForChild("Humanoid").JumpPower = prevJumpPower
- equipped = false
- end)
- function SignalError()
- SetSpeed_label.TextColor3 = Color3.fromRGB(232, 23, 23)
- wait(3)
- SetSpeed_label.TextColor3 = Color3.new(0, 0, 0)
- end
- function SignalSuccess()
- SetSpeed_label.TextColor3 = Color3.fromRGB(51, 204, 40)
- wait(3)
- SetSpeed_label.TextColor3 = Color3.new(0, 0, 0)
- end
- SetSpeed.FocusLost:Connect(function(enter)
- if enter == true then
- if tonumber(SetSpeed.Text) ~= nil then
- speed = tonumber(SetSpeed.Text)
- if equipped == true then
- plrchar:WaitForChild("Humanoid").WalkSpeed = speed
- end
- SignalSuccess()
- SetSpeed.Text = ""
- else
- SignalError()
- SetSpeed.Text = ""
- end
- else
- SetSpeed.Text = ""
- end
- end)
- plrchar:WaitForChild("Humanoid").Died:Connect(function()
- gui:Destroy()
- script:Destroy()
- end)
Advertisement
Add Comment
Please, Sign In to add comment