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

umm guys i how to change the Object that follows me? here is my code

Asked by 7 years ago

umm guys i how to change the Object that follows me? here is my code

local torso = script.Parent.HumanoidRootPart

local center = Instance.new("Part")
    center.CanCollide = false
    center.Size = Vector3.new(1,1,1)
    center.Parent = game.Workspace
local bp = Instance.new("BodyPosition")
    bp.maxForce = Vector3.new(9e+100, 9e+100, 9e+100)
    bp.P = 40000
    bp.Parent = center

while torso.Parent do
    center.BodyPosition.position = torso.Position
    wait()
end

center:Remove()

and what will i add that if the object go to my torso it will disappeard and will go to the leaderboard named Gem Collects and thats it Thank you

0
if u want to help me just join this https://discord.gg/PwtJgmu discord or add me my name is FZSLegend Thank you.. :D FZSLegend 2 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Before your while loop add this:

center.Touched:connect(function(other)
    if(other == torso) then
            --Add leader board stuff
    end
end)

I'm pretty new here but from what I understand this website is like stack overflow. We aren't supposed to write entire scripts for you. In the if statement add the rest to update the leaderboard. Roblox wiki page is here : http://wiki.roblox.com/index.php?title=Leaderboard

Ad

Answer this question