Hello, I’m trying to make a tycoon, but when a player triggers a proximity prompt, their team should be set to the team that the tycoon has, in a string value. Why isn’t this working though?
-- Claim Tycoon
local Claimer = script.Parent.Claimer
local PP = Claimer.ProximityPrompt
-- Values
local TycoonValues = script.Parent.TycoonValues
local Team = TycoonValues.Team
local Owner = TycoonValues.Owner
local Claimed = TycoonValues.Claimed
-- Teams
local Teams = game:GetService("Teams")
local NoTeam = Teams["No Team"]
PP.Triggered:Connect(function(plr)
if Owner.Value == "" then
if Claimed.Value == false then
if plr.Team == NoTeam then
plr.Team = Team.Value -- issue
PP.Enabled = false
Claimer.Transparency = 1
Claimer.CanCollide = false
end
end
end
end)
error:
Unable to assign property Team. Object expected, got string - Server - Main:20