Im trying to make a script that get triggered when a player triggers a proximity prompt. In the srcipt, i wrote that you need to be in a specific team in order for the script to work.
ok ill send the code, and also even if i added ==, it doesnt work, its not printing the message in the output.
heres the code:
local Teams = game:GetService(“Teams”)
local CashierTeam = Teams.Cashier
local ProximityPrompt= game.Workspace.Customer1.Torso.ProximityPrompt
ProximityPrompt.Triggered:Connect(function(Player)
if Player.Team.Name == CashierTeam then
game.ReplicatedStorage.CustomerOrder1:FireClient(Player)
print(“Order Placed”)
ProximityPrompt.Enabled = false
elseif Player.Team.Name.Cashier == false then
print(“Order Failed, Player isn’t in the right team”)
im not getting any errors, there isnt any, its just not working
i wrote that because if the playeer that triggers the proximity prompt isnt in the good team, the script doesnt do anything for them
local Teams = game:GetService(“Teams”)
local CashierTeam = Teams.Cashier
local ProximityPrompt= game.Workspace.Customer1.Torso.ProximityPrompt
ProximityPrompt.Triggered:Connect(function(Player)
if Player.Team.Name == CashierTeam then
game.ReplicatedStorage.CustomerOrder1:FireClient(Player)
print(“Order Placed”)
ProximityPrompt.Enabled = false
elseif Player.Team.Name ~= "Cashier" then
print(“Order Failed, Player isn’t in the right team”)
end
end)