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

Why does the player keep getting teleported to the part?

Asked by 4 years ago

I have a skeleton that supposed to latch on to the players torso when its activated but it keeps teleporting the player to the skeleton despite it being unanchored.Even tho it teleports the player to it the player can still move freely with it.

0
did u write the script urself? 4581quzwi 0 — 4y
0
Yes but I use the same script for another item which is just a ribcage and it works perfectly fine BookOfTragedy 27 — 4y
0
can u maybe upload the script so i can see whats wrong? 4581quzwi 0 — 4y
0
Ill upload it in the answer under BookOfTragedy 27 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
local ReplicatedStorage = script.Parent
local FormEvent = ReplicatedStorage:WaitForChild("Amaterasu")
local DeactivateEvent = ReplicatedStorage:WaitForChild("Stop")
local user = script.Parent.Parent.Parent
local mouse = user:GetMouse()
local using = false













local function FormEventFired()
using = true
 game:GetService("Chat"):Chat(user.Character.Head, "Susano..")


local blood = Instance.new("Decal")
   blood.Face = "Front"
   blood.Name = "SauceBlood"
   blood.Texture = "rbxassetid://979714899"
   blood.Parent = user.Character.Head
   user.Character.Humanoid.Health = user.Character.Humanoid.Health - 5
 game.Debris:AddItem(user.Character.Head.SauceBlood, 5)

  script.Deplete.Value = true




local g = script.Parent.Chest:clone()
        g.Parent = user.Character
        local C = g:GetChildren()
        for i=1, #C do
            if C[i].className == "UnionOperation" then
                local W = Instance.new("Weld")
                W.Part0 = g.Middle
                W.Part1 = C[i]
                local CJ = CFrame.new(g.Middle.Position)
                local C0 = g.Middle.CFrame:inverse()*CJ
                local C1 = C[i].CFrame:inverse()*CJ
                W.C0 = C0
                W.C1 = C1
                W.Parent = g.Middle
            end
                local Y = Instance.new("Weld")
                Y.Part0 = user.Character.Torso
                Y.Part1 = g.Middle
                Y.C0 = CFrame.new(0,0,0)
                Y.Parent = Y.Part0
        end

        while using do
             wait(0.2)
             user.Character.Humanoid.Health = user.Character.Humanoid.Health + 0
        end

 end


local function DeactivateEventFired()
    using = false
    user.Character.Chest:Destroy()
    script.Deplete.Value = false
    local addon = user.stats.Level.Value * 2

end

FormEvent.OnServerEvent:Connect(FormEventFired)

script.Parent.Parent.MS.DeactivateEvent.OnServerEvent:connect(DeactivateEventFired)
DeactivateEvent.OnServerEvent:Connect(DeactivateEventFired)

Ad

Answer this question