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

How can I make a script check if you are on a teamby using a Promiximty Prompt?

Asked by 3 years ago
Edited 3 years ago

So, I am trying to make something check if you are a team but its not working it keeps saying that I am not on the team but I am, Could anyone help?

local players = game:GetService("Players")
local Teams = game:GetService("Teams")

script.Parent.Attachment.ProximityPrompt.Triggered:Connect(function(player)
    if player.Team == Teams.engineer then
        script.Parent.Transparency = 0
        script.Parent.Attachment.ProximityPrompt.MaxActivationDistance = 0
    else
        print("Not on team")
    end
end)


0
Instead of doing "Teams.engineer" try doing "engineer". I'm not too sure, but that MIGHT work. CoolBlueJay000 48 — 3y
0
So, "if player.Team == "engineer" then" CoolBlueJay000 48 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

I hopped into studio and messed around with it. What I've done to get this to work is the following

workspace.Part.ProximityPrompt.Triggered:Connect(function(player)
    print('Within distance')

    if (player.Team == game:GetService('Teams'):FindFirstChild('Engineer')) then
        print('woohoo!')
    else
        print('Not on team.')
    end
end)
0
That literally changed nothing Ziffixture 6913 — 3y
Ad

Answer this question