I’m doing some testing with Mouse Position, the script i’m making is just supposed to get the mouse position and clone a part at it, these are my scripts so far:
LOCALSCRIPT
local Player = game:GetService('Players').LocalPlayer
local Mouse = Player:GetMouse()
script.Parent.Activated:Connect(function()
game:GetService('UserInputService').InputBegan:Connect(function(i,o)
if o then return end
if i.UserInputType == Enum.UserInputType.MouseButton1 then
local MousePos = Mouse.Hit.p
game.ReplicatedStorage.Events.Teleport:FireServer(Player, MousePos)
end
end)
end)
SERVERSCRIPT
game.ReplicatedStorage.Events.Teleport.OnServerEvent:Connect(function(Player, MousePos)
local clone = game.ServerStorage.Part:Clone()
clone.Parent = workspace
clone.CFrame = MousePos
end)
– I also tried .Position instead of CFrame.
Output:
ServerScriptService.Script:4: invalid argument #3 (CFrame expected, got Instance)