Im trying to make it so when you click a button player walkspeed increases to X.
Whenever I click the button, it doesn’t respond. No functions work which leads me to believe its the variables and not the Mouse:connect function.
Here is the script: local player = game.Players.LocalPlayer local char = player.CharacterAdded:wait() local h = char.Humanoid
--Increase speed by X when clicked. script.Parent.MouseButton1Click:Connect(function() h.WalkSpeed = 99 print("Speed exploits have been fired!") end)
Before you get mad no I’m not making exploits, I’m making an exploit testing plugin.
If you run the function(in a local script in a text button) nothing will happen and no print will be in the output. The thing is no bugs occur in my game and I’m getting the vars directly from roblox ed hub. Any help is thanked!
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local h = char:WaitForChild("Humanoid")
--Increase speed by X when clicked.
script.Parent.MouseButton1Click:Connect(function()
print("Event fired")
h.WalkSpeed = 99
print("Speed exploits have been fired!")
end)
Np, also as a side note even though the Character may load when using CharacterAdded:Wait(), it may not be able to load the Humanoid in time as well so just to be sure use the WaitForChild() function so that it yields until the current object is found
Example:
local Part = workspace:WaitForChild("Part") --Will wait until a part is found, now we know it's there