hey i making a a tool where the player gains speed when used but im having an issue. i created a remote event to tween the players field of view when used but it doesn’t seem to work? why is this? the prints dont run so im assuming the server never sends the signal to fire the remote event, only thing is that it does fire the client.
– server
remoteEvent.OnServerEvent:Connect(function(player)
if player:GetAttribute("IsRunning") then return end
local backpack = player.Backpack
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChild("Humanoid")
local loadedAnimation = humanoid:LoadAnimation(anim)
local normalWalkspeed = humanoid.WalkSpeed
local normalWalkJump = humanoid.JumpPower
local adrenalatiedWalspeed = humanoid.WalkSpeed * 1.7
local adrenalatiedJump = humanoid.JumpPower * 1.7
local rightArm = character:FindFirstChild("Right Arm")
loadedAnimation:Play()
loadedAnimation.Stopped:Wait()
local bdattach = tool.bodyAttach
humanoid:UnequipTools()
repeat task.wait() until tool.Parent == backpack
task.wait(0.05)
for _, weld in ipairs(bdattach:GetChildren()) do
if weld:IsA("Weld") then
weld:Destroy()
end
end
tool.Parent = workspace
debris:AddItem(tool, 10)
print("nice")
cameraEvent:FireClient(player, 100)
humanoid.WalkSpeed = adrenalatiedWalspeed
humanoid.JumpPower = adrenalatiedJump
task.wait(7)
cameraEvent:FireClient(player, 70)
humanoid.WalkSpeed = normalWalkspeed
humanoid.JumpPower = normalWalkJump
end)
-- client
local cameraEvent = tool:WaitForChild("cameraEvent")
local tweenService = game:GetService("TweenService")
local twi = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, 0, false)
cameraEvent.OnClientEvent:Connect(function(amount)
local camera = game.Workspace.Camera
camera.CameraType = Enum.CameraType.Scriptable
warn("BEFORE" .. camera.FieldOfView)
local cameraTween = tweenService:Create(camera, twi, {FieldOfView = amount}):Play()
warn("NOW" .. camera.FieldOfView)
end)