Hello,
I am working on a tycoon; And whenever the player touches a door it should change the Owner value inside of the tycoon to the player, and change the team.
It does change the ObjectValue to the player but it does not change the team.
It’s in a Script:
local TouchPart = script.Parent
TouchPart.Touched:Connect(function(hitPart)
if hitPart.Parent:FindFirstChild("Humanoid") then
local Player = game:GetService("Players"):GetPlayerFromCharacter(hitPart.Parent)
if game:GetService("ServerStorage"):WaitForChild("PlayerMoney"):FindFirstChild(Player.Name).TycoonOwned.Value == nil then
if TouchPart.Parent.Parent.Parent.Owner.Value == nil then
print("Change Team")
Player.Team = game:GetService("Teams"):WaitForChild(hitPart.Parent.Parent.Parent.Name, 60)
TouchPart.Parent.Parent.Parent.Owner.Value = Player
end
end
end
end)
I have tried changing the TeamColor and it still does not work.
Is there an issue in my script or is this a bug?
It does not return any errors it all works but that.
Thanks in advance.