It all works besides line 67 which I can't figure out what I need to put there so that a player can not just use the healing ability without any limitations.
Here's the script:
THANK YOU SO MUCH IN ADVANCE!
-- SETTINGS
local offset = Vector3.new(40, 80, 0)
local plr = game.Players.LocalPlayer
local sg = game:GetService("StarterGui")
sg:SetCore("TopbarEnabled", false)
local mouse = plr:GetMouse()
local hmnd = plr.Character:FindFirstChild("Humanoid")
hmnd.MaxHealth = script.MAXHP.Value
hmnd.JumpPower = 0
hmnd.AutoRotate = false
local cam = game.Workspace.CurrentCamera
local fov = 70
local speedval = 18.5
local runService = game:GetService("RunService")
sg:SetCore("TopbarEnabled", false)
cam.FieldOfView = fov
mouse.Icon = "http://www.roblox.com/asset/?id=611298909"
hmnd.WalkSpeed = speedval
local function onRenderStep()
local pos = plr.Character.Torso.Position --Adds the position values of the player's position and the previously set offset
local campos = pos + offset
cam.CoordinateFrame = CFrame.new(campos, pos) --Sets the camera's position to have an X value of the player's position and the Y value of camPos which is the player position plus the set offset
plr.Character.Torso.CFrame = CFrame.new(plr.Character.Torso.Position,Vector3.new(mouse.Hit.p.X, plr.Character.Torso.Position.Y, mouse.Hit.p.Z))
end
runService:BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, onRenderStep)
-- USER INPUT
-- ABILITIES
uis = game:GetService("UserInputService")
local canBeUsed = false
function hpRegen(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.Q and hmnd.Health < hmnd.MaxHealth and canBeUsed == true then
canBeUsed = true
local hp = hmnd.Health
local increase = script.HPBOOST.Value
hmnd.Health = math.min(hmnd.Health + increase, hmnd.MaxHealth)
local hpfxone = game.ServerStorage.hpgaineffect:Clone()
hpfxone.Parent = plr.Character.Torso
local hpfxtwo = game.ServerStorage.hpgaineffect:Clone()
hpfxtwo.Parent = plr.Character.Torso
local fire = game.ServerStorage.hpfire:Clone()
fire.Parent = plr.Character.Torso
wait(1.45)
hpfxone:Destroy()
hpfxtwo:Destroy()
fire:Destroy()
-- PUT STUFF HERE
end
end
function speedUpgrade(inputObject, gameProcessedEvent, placetime, timewaited)
if inputObject.KeyCode == Enum.KeyCode.LeftShift and canBeUsed== true then
canBeUsed = true
cam.FieldOfView = 85
while hmnd.WalkSpeed > 18.5 do
wait(0.5)
hmnd.WalkSpeed = hmnd.WalkSpeed - 1.25
if hmnd.WalkSpeed == 17.5 then
wait(0.1)
canBeUsed = true
end
end
end
end
function speedUpgradeEnd()
hmnd.WalkSpeed = script.DEFAULTSPEED.Value
cam.FieldOfView = 70
end
uis.InputBegan:connect(hpRegen)
uis.InputBegan:connect(speedUpgrade)
uis.InputEnded:connect(speedUpgradeEnd)

2 comments
This script will not work you are accessing "ServerStorage" in a local script.
I don't think thats the case as it was working earlier