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

Re spawn GUI, ship only appears for the player that spawned it, help?

Asked by 6 years ago
Edited 6 years ago

I am trying to fix a gui that lets me spawn in a ship, it will appear for the player who spawned it and only that player. The game is FE enabled, anyone know how to fix it?

print("Regen GUI made by AzulFX/Vandalized by boatmaster6602")

 Player = game.Players.LocalPlayer

for i, v in pairs(script.Parent:GetChildren()) do
    if v:IsA("TextButton") then
        v.MouseButton1Click:connect(function()
            local Ship = game.Lighting:WaitForChild(v.Name):clone()
            local Folder = game.Workspace:WaitForChild(Player.Character.Name)
            Folder:ClearAllChildren()
            Ship.Parent = Folder
            Ship:MoveTo (Player.Character.Torso.Position)
        end)
    end
    end

1 answer

Log in to vote
0
Answered by
OfcPedroo 396 Moderation Voter
6 years ago
Edited 6 years ago

I would say it's because you're putting the Visible in the PlayerGui... I think that if you want the Gui to enable to EVERY player, you have to use StarterGui.. Give it a try!

game.Players.PlayerAdded:connect(function(player)
print("Regen GUI made by AzulFX/Vandalized by boatmaster6602")

for i, v in pairs(script.Parent:GetChildren()) do
    if v:IsA("TextButton") then
        v.MouseButton1Click:connect(function()
            local Ship = game.Lighting:WaitForChild(v.Name):clone()
            local Folder = game.Workspace:WaitForChild(Player.Character.Name)
            Folder:ClearAllChildren()
            Ship.Parent = Folder
            Ship:MoveTo (Player.Character.Torso.Position)
        end)
    end
end

Ok so, I just adapted your localscript to a script, because apparently you need to use a script. Also gave your script some indentation.

Alright, if this solved your problem, please mark as the answer :'( xD

As always, good scripting!

0
It is the StarterGui I'm afraid. boatmaster6602 0 — 6y
0
what do you mean with "afraid"? OfcPedroo 396 — 6y
0
Oh, I mean it is the StarterGui, that's just how I word things. boatmaster6602 0 — 6y
0
Just to know, you think that, or are you sure? OfcPedroo 396 — 6y
View all comments (10 more)
0
I think, I'm new to this sort of thing. boatmaster6602 0 — 6y
0
You have to put this in a server script if this is filtering enabled. RayCurse 1518 — 6y
0
Give a look at the script. OfcPedroo 396 — 6y
0
Now it's not working period boatmaster6602 0 — 6y
0
"period" !? OfcPedroo 396 — 6y
0
It's how I word things. boatmaster6602 0 — 6y
0
Yeah, but I didn't understand, what's the error there? OfcPedroo 396 — 6y
0
Now nothing spawns boatmaster6602 0 — 6y
0
im pretty sure if you use a normal script it will count as everyone but if you use a local script it will count as one player BluesteelKd 2 — 6y
0
what makes you think that? OfcPedroo 396 — 6y
Ad

Answer this question