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

Claim door script Allowing players to claim multiple tycoons? [closed]

Asked by 3 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

Code:

local tycoon = script.Parent.Parent.Parent.Parent.Parent
local gate = script.Parent

gate.Touched:Connect(function(Hit)
    local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
    if Player then
        local Humanoid = Hit.Parent:FindFirstChild("Humanoid")
        if Humanoid then
            if Hit.Parent.Humanoid.Health >= 1 then
                if script.Parent.Transparency == 0 then
                    if gate.Transparency == 0 then
                        for i, tycoonModel in pairs(script.Parent.Parent.Parent.Parent.Parent.Parent:GetChildren()) do
                            if tycoonModel:IsA("Model") then
                                if tycoonModel.Owner.Value ~= Player then
                                    if tycoonModel.Owner.Value == nil then
                                        if script.Parent.Parent.Parent.Parent.Parent.Owner.Value == nil then
                                            gate.Transparency = .7
                                            gate.CanCollide = false
                                            tycoon.Owner.Value = Player
                                            Player.TeamColor = script.Parent.Parent.Parent.Parent.Parent.TeamColor.Value
                                            gate.GateGui.TextLabel.Text = Player.Name.."'s Tycoon!"
                                        end 
                                    end
                                end
                            end
                        end
                    end
                end 
            end
        end
    end
end)
0
What's the question? NotTheChara 191 — 3y
0
It is allowing players to claim multiple tycoons NillaTheCat12345 14 — 3y
0
Is there an error, i dont have enough context to know what you need. Are you asking how to make a script to allow players to claim multiple tycoons rookiecookie153 53 — 3y
0
No. I am trying to make a 2 player tycoon. NillaTheCat12345 14 — 3y
View all comments (4 more)
0
soooooo what do you need help with then? rookiecookie153 53 — 3y
0
If the problem is that the player can claim more tycoons, then make some code that doesn't allow them to do so. rabbi99 714 — 3y
0
It is, but i dont know how to. NillaTheCat12345 14 — 3y
0
*No errors* `Roblox Lua` NillaTheCat12345 14 — 3y

Closed as Not Constructive by JesseSong

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?