Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Carry Script is creating errors but, I can't fix them. Is there anyway to fix this?

Asked by 4 years ago
Edited 4 years ago

Hello, I am trying to achieve a carry system for carrying players like in Adopt Me, It's been going good good up until the weld part. I have never used welds so, I looked at some previous methods and tried but none of them seemed to work.

This is all the code, I have so far:

01local PS = game:GetService("PhysicsService")
02local CarryModule = {}
03local Carryed = {}
04 
05function CarryModule:Carry(Plr, IsCarrying, FirstPly)
06    if not Carryed[FirstPly] then
07    print("Player:",Plr," Carry Value:",IsCarrying," Carrying:",FirstPly)
08    Carryed[FirstPly] = (Plr.Name.."*"..FirstPly)
09    print(Carryed[FirstPly])
10 
11    PS:CreateCollisionGroup("CarryPhysics")
12    PS:CollisionGroupSetCollidable("CarryPhysics", "CarryPhysics", false)
13 
14    local Plr, FirstPly = FirstPly.Character.Head, Plr.Character.PrimaryPart
15    FirstPly.Character.Humanoid.PlatformStand = true
View all 60 lines...

The errors seem to occur at line 15 and 48:

08:34:05.446 - ServerScriptService.CarryModuleScript:15: attempt to index nil with 'Head'

08:34:06.779 - ServerScriptService.CarryModuleScript:48: attempt to index nil with 'Humanoid'

If someone is able to help, I'd really appreciate it.

0
On line 15, do you mean Plr and not FirstPly? Spjureeedd 385 — 4y

Answer this question