So imma cut right to the chase and show the code:

local ownerValue = script.Parent.Parent.Parent.Parent.Values:WaitForChild("Owner", 5).Value

script.Parent.Touched:Connect(function(touched)
	if touched.Parent:FindFirstChild('Humanoid') and ownerValue == nil then
		script.Parent.BillboardGui.TextLabel.Text = touched.Parent.Name .. "'s tycoon"	
		script.Parent.Color = Color3.fromRGB(0, 255, 0)
		
		ownerValue = touched.Parent
		print(ownerValue)
	end
end)

That is the script that makes a value called "Owner" the person who touches the claim door

script.Parent.MouseClick:Connect(function(who)
	if game.Workspace.Tycoons.AttackOnTitan.Values.Owner.Value == who.Character then
		print('hi')
		
		local cash = Instance.new('Part')
		cash.Name = 'Block'
		cash.Color = Color3.fromRGB(0, 0, 255)
		cash.Size = Vector3.new(1, 1, 1)
		cash.CFrame = script.Parent.Parent.Parent.DropPart.CFrame
		cash.Parent = workspace

		local sellAmount = Instance.new('IntValue')
		sellAmount.Value = 3
		sellAmount.Name = 'SellFor'
		sellAmount.Parent = cash
	else
		print(who.Name)
	end
end)

This is the script for the manual dropper to gain cash and it only works with the "else" statement. I been trying all day. (BTW im reteaching myself to code so a little bit of description would be helpful)

1 comment

0

If you're using teams for each of the players tycoons then it would probably be a matter of finding out the players team