I am pretty sure you can’t fire the mouse to the server, maybe fire the mouse.hit.p to the server.
When I fired the mouse to the server in the past, it was nil.
Could you show us what you are firing inside of the remote event, I’m assuming you are sending the parameter of Mouse.Hit to be able to call Mouse.p? If you aren’t firing that then that should be your problem, to be able to access the position from the mouse, you need to call Mouse.Hit.
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.X and cd == false then
cd = true
game.ReplicatedStorage.HieMi.IcePol.IceBird:FireServer(Mouse.Hit)
wait(5)
cd = false
end
end)
I’m assuming that
Mouse = game.Players.LocalPlayer:GetMouse()
right?
Also, in that first bit you posted, “bodyVelo.Velocity = icebird.CFrane.lookVector * 125”
is supposed to be “bodyVelo.Velocity = icebird.CFrame.lookVector * 125”
Did you fire the mouse.Hit to the server? The player’s mouse and not the Hit.P of the mouse?
I think you should fire the Hit.P of the mouse and not the mouse.Hit, but I am not sure.
like this:
local uis = game:GetService(“UserInputService”)
local cd = false
local Mouse = game.Players.LocalPlayer:GetMouse()
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Z and cd == false then
cd = true
game.ReplicatedStorage.HieMi.IcePol.IceFloorka:FireServer()
wait(5)
cd = false
end
end)
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.X and cd == false then
cd = true
game.ReplicatedStorage.HieMi.IcePol.IceBird:FireServer(Mouse.Hit)
wait(5)
cd = false
end
end)
Try to fire the Mouse.Hit.P instead of Mouse.Hit, and in the server remove the .p after the mouse. That way you fire a position.
Like this I think:
This is local script (StarterPlayerScripts)
local uis = game:GetService(“UserInputService”)
local cd = false
local Mouse = game.Players.LocalPlayer:GetMouse()
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Z and cd == false then
cd = true
game.ReplicatedStorage.HieMi.IcePol.IceFloorka:FireServer()
wait(5)
cd = false
end
end)
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.X and cd == false then
cd = true
game.ReplicatedStorage.HieMi.IcePol.IceBird:FireServer(Mouse.Hit.p)
wait(5)
cd = false
end
end)
I’d also just like to comment that it’s bad practice to use the same connection twice, along with letting cooldowns be client sided as that’s easily exploitable.
-- Local Script
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(Input, Process)
if not Process and Input.UserInputType == Enum.UserInputType.Keyboard then
if Input.KeyCode == Enum.KeyCode.Z then
game.ReplicatedStorage.HieMi.IcePol.IceFloorka:FireServer()
elseif Input.KeyCode == Enum.KeyCode.X then
game.ReplicatedStorage.HieMii.IcePol.IceBird:FireServer(Mouse.Hit.p)
end
end
end)
--Server
local Debounce = {}
game.ReplicatedStorage.HieMii.IcePol.IceBird.OnServerEvent:Connect(function(Player, Position)
if Player and Player.Character and Player.Character:FindFirstChild("HumanoidRootPart") and not Debounce[Player] then
Debounce[Player] = true
local Character = player.Character
local soundik = Instance.new("Sound", Character.Torso)
soundik.SoundId = "rbxassetid://3744391247"
soundik.MaxDistance = 300
local icebird = game.ReplicatedStorage.HieMi.IcePol.anivia:Clone()
icebird.CFrame = CFrame.new(Character.Head.CFrame.p , Position) + CFrame.new(Character.Head.CFrame.p , Position).lookVector * 3
local bodyVelo = Instance.new("BodyVelocity")
bodyVelo.Velocity = icebird.CFrane.lookVector * 125
bodyVelo.MaxForce = Vector3.new(1e6, 1e6, 1e6)
bodyVelo.Parent = icebird
icebird.Parent = workspace
delay(5, function()
if Player then Debounce[Player] = false end
end)
end
end)