Hey everyone! I was testing a keybinded function where when you press “E”, it would fire the remote event, and give you the mouse’s target.
And I got an error of how its indexing nil with Mouse.Target. Here is my script:
local rs = game:GetService("ReplicatedStorage")
local spin = rs:WaitForChild("DreamArt") -- A demon slayer art test
spin.OnServerEvent:Connect(function(player)
local character = player.Character
local humanoid = character.Humanoid
local mouse = player:GetMouse()
print(mouse.Target)
end)
local rs = game:GetService("ReplicatedStorage")
local spin = rs:WaitForChild("DreamArt") -- A demon slayer art test
spin.OnServerEvent:Connect(function(player, target)
local character = player.Character
local humanoid = character.Humanoid
print(target)
end)