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

how to make the checkpoint appear for each person?

Asked by 8 years ago
local redlight = game.Workspace.StartLight.RedModel.LightBulb.PointLight
local yellowlight = game.Workspace.StartLight.YellowModel.LightBulb.PointLight
local greenlight = game.Workspace.StartLight.GreenModel.LightBulb.PointLight
local checkpoint1 = game.Workspace.CheckPoint1
local checkpoint2 = game.Workspace.CheckPoint2


wait(2)

redlight.Enabled = true
wait(2)
redlight.Enabled = false

yellowlight.Enabled = true
wait(2)
yellowlight.Enabled = false

greenlight.Enabled = true
wait(2)
greenlight.Enabled = false

checkpoint1.Transparency = 0.3
checkpoint1.CanCollide = false

function checkpoint1hit(otherpart)
    print ("checkpoint1 was hit")
    print (otherpart.Name)
    if otherpart ~= nil and otherpart.Parent ~= nil and otherpart.Parent:FindFirstChild("Humanoid")then
        checkpoint2.Transparency = 0.3
        checkpoint2.CanCollide = false
        checkpoint1.Transparency = 2
        checkpoint1.CanCollide = false
        if not checkpoint1:FindFirstChild(otherpart.Parent.Name)then
        local PlayerTag = Instance.new("StringValue")
        PlayerTag.Parent = checkpoint1
        PlayerTag.Name = otherpart.Parent.Name
        end
    end
end

function checkpoint2hit(otherpart)
    print ("checkpoint2 was hit")
    print (otherpart.Name)
    if otherpart ~= nil and otherpart.Parent ~= nil and otherpart.Parent:FindFirstChild("Humanoid")then
        checkpoint2.Transparency = 2
        checkpoint2.CanCollide = false
        if not checkpoint2:FindFirstChild(otherpart.Parent.Name) and checkpoint1:FindFirstChild(otherpart.Parent.Name)then
        local PlayerTag = Instance.new("StringValue")
        PlayerTag.Parent = checkpoint2
        PlayerTag.Name = otherpart.Parent.Name
        end
    end
end
checkpoint1.Touched:connect(checkpoint1hit)
checkpoint2.Touched:connect(checkpoint2hit)

i want the checkpoints to appear for each person, so basically when the race starts if 1 of the racers get a checkpoint the checkpoint should stay on other players screen and they have to get the checkpoint to win the race please can i get some help on this i really need it

1 answer

Log in to vote
1
Answered by
Dr_Doge 100
8 years ago

Well You can use the players Camera...

Cameras are Very Special and can be used to do ALOT of stuff.

If you Put a Part inside a CurrentCamera, then the person who owns the Camera can see the part, but for everyone else, the Part dose't Exist.

As far as I know, u can only access CurrentCameras with LocalScripts but I have't tryed to access a current camera with a normal script...

I hope this helps... Im just typing whats on my head...

Ad

Answer this question