You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I wanted someone to help with me. (Making grab people dead body.)
What is the issue? Include screenshots / videos if possible!
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I didn’t even found single yet.
LOCAL script:
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local UIS = game:GetService("UserInputService")
local playerS = game:GetService("Players")
local distance = 15
local debounce = false
local undrag = game:GetService("ReplicatedStorage"):WaitForChild("UnDragPlayer")
local drag = game:GetService("ReplicatedStorage"):WaitForChild("DragPlayer")
UIS.InputBegan:Connect(function(i, g)
print("input beganned")
if g then
return
else
if i.KeyCode == Enum.KeyCode.E and mouse.Target then
print("yes")
drag:FireServer(Player, mouse.Target.Parent)
print("fired")
end
end
end)
Remote Server Script:
dragplayerevent.OnServerEvent:Connect(function(plr, target)
local ropeC = Instance.new("RopeConstraint")
ropeC.Attachment0 = plr.Character:WaitForChild("Right Arm")
ropeC.Attachment1 = target:WaitForChild("UpperTorso")
end)
That’s because you’re trying to set a part has an Attachment. You must create an attachment, make the target part its parent and then attach the rope to that attachment
RopeConstraint Attachment0 and Attachment1 properties only accepts Attachment class objects. You need to create an attachment object under the parts you want to connect with RopeConstraint then set RopeConstraint Attachment1 and Attachment0 properties to those attachments. The fixed code should look like this:
Also you don’t have to add a player parameter for FireServer function because the game sets that as the first parameter for you, you just have to put the arguments you want into that function.
Yes because when you fire the event with FireServer(Player, mouse.Target.Parent) the event will have 3 parameters, not 2 because the function adds the first parameter as LocalPlayer automatically so in order to fix that issue just use FireServer(mouse.Target.Parent) so the target can be the 2nd parameter like it’s supposed to be when you fire the event.