|
| 17 Aug 2015 05:51 PM |
| I was script my game and everything works fine and all on studio but on game mode were people can join you it wont work does anybody know how to make it work |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 17 Aug 2015 05:51 PM |
| it's because you scripted something wrong |
|
|
| Report Abuse |
|
|
Luxurize
|
  |
| Joined: 31 Mar 2015 |
| Total Posts: 1289 |
|
|
| 17 Aug 2015 05:58 PM |
It would help if you posted the script? We're not magicians, you know.
“Psychopaths are not crazy. They are fully aware of what they do and the consequences of those actions.” |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 06:01 PM |
oh Sorry here it is
-- Made By Stephen039
local maptime = 10 local Gui = game.ServerStorage["Changing Map"] local maps = game.Lighting.Maps:GetChildren()
while true do local getmap = maps[math.random(1,#maps)] getmap.Parent = game.Workspace wait(5) wait(maptime) Gui.Parent = game.StarterGui Gui.Parent = game.Players.Player.PlayerGui wait(5) game.Players.Player.PlayerGui["Changing Map"].Parent = game.ServerStorage getmap.Parent = nil print("Selecting new map...") wait(3) end |
|
|
| Report Abuse |
|
|
71428
|
  |
| Joined: 06 Aug 2015 |
| Total Posts: 339 |
|
|
| 17 Aug 2015 06:13 PM |
This is your problem
Gui.Parent = game.Players.Player.PlayerGui wait(5) game.Players.Player.PlayerGui["Changing Map"].Parent = game.ServerStorage
game.Players.Player only exists in offline mode. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 06:15 PM |
so how do i fix it to make it work on online
|
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 06:24 PM |
| local scripts are a pretty good deal with game.Players.LocalPlayer |
|
|
| Report Abuse |
|
|
76km
|
  |
| Joined: 14 Aug 2015 |
| Total Posts: 5455 |
|
|
| 17 Aug 2015 06:26 PM |
its not a bug
its a local script 1 and if its a global script you haven't waited for the character. I place a bool value determining whether they are in the game, or not. |
|
|
| Report Abuse |
|
|
76km
|
  |
| Joined: 14 Aug 2015 |
| Total Posts: 5455 |
|
|
| 17 Aug 2015 06:28 PM |
i know
for _, v in pairs (game.Players:GetChildren()) do if v.Character then --your GUI code here. Refer player as v so for playerGUI do v.PlayerGui end end
make sure its in a loop. dont place waits in there. Im serious, go to coroutines for that. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2015 06:34 PM |
Can You Type the Script Out How You Would Type it because i am a begginer at scripting
|
|
|
| Report Abuse |
|
|
76km
|
  |
| Joined: 14 Aug 2015 |
| Total Posts: 5455 |
|
|
| 17 Aug 2015 06:38 PM |
local maptime = 10 local Gui = game.ServerStorage["Changing Map"] local maps = game.Lighting.Maps:GetChildren()
while true do local getmap = maps[math.random(1,#maps)] getmap.Parent = game.Workspace wait(5) wait(maptime) Gui.Parent = game.StarterGui Gui.Parent = game.Players.Player.PlayerGui wait(5) for _, v in pairs (game.Players:GetChildren()) do if v.Character then
--PLACE YOUR gooey code here. Refer player as v. So to get to Playergui do v.PlayerGui. to get to character do v.Character
end end game.Workspace:FindFirstChild(getmap.Name) print("Selecting new map...") wait(3) end
this is very messy code. No joke
|
|
|
| Report Abuse |
|
|
Luxurize
|
  |
| Joined: 31 Mar 2015 |
| Total Posts: 1289 |
|
|
| 17 Aug 2015 06:42 PM |
for _,c in pairs(game.Players:GetChildren()) do if v.Character then local maptime = 10 local Gui = game.ServerStorage["Changing Map"] local maps = game.Lighting.Maps:GetChildren() while true do local getmap = maps[math.random(1,#maps)] getmap.Parent = game.Workspace wait(5) wait(maptime) Gui:Clone.Parent = game.StarterGui Gui:Clone.Parent = v.PlayerGui Wait(5) v.PlayerGui["Changing Map"]:Destroy() getmap.Parent = nil Print("Selecting new map...") Wait(3) end end end
Next time, do this yourself. I should've been going somewhere.
“Psychopaths are not crazy. They are fully aware of what they do and the consequences of those actions.” |
|
|
| Report Abuse |
|
|
| |
|
76km
|
  |
| Joined: 14 Aug 2015 |
| Total Posts: 5455 |
|
|
| 17 Aug 2015 06:44 PM |
lux, this will do it in twos and will stop being spontaneous.
so 2 people will have this popup, but the next 2 won't for the amount of waits.
My code works. To make his work you need to use coroutines. |
|
|
| Report Abuse |
|
|
76km
|
  |
| Joined: 14 Aug 2015 |
| Total Posts: 5455 |
|
|
| 17 Aug 2015 06:46 PM |
GuiCode is like removing Guis, moving it etc
so if I wanted to move a frame i'd do in the GuiFrame
v.PlayerGui.Frame;TweenPosition(UDim2.new("Quad", "Out", 0, 0, 0, 0, 1))
that is my GUI code. |
|
|
| Report Abuse |
|
|
76km
|
  |
| Joined: 14 Aug 2015 |
| Total Posts: 5455 |
|
|
| 17 Aug 2015 06:53 PM |
local maptime = 10 local Gui = game.ServerStorage["Changing Map"] local maps = game.Lighting.Maps:GetChildren()
while true do local getmap = maps[math.random(1,#maps)] getmap.Parent = game.Workspace wait(5) wait(maptime) for _, player in pairs (game.Players:GetChildren()) do local y =Gui:Clone() y.Parent = player.PlayerGui end wait(5) for _, player2 in pairs (game.Players:GetChildren()) do local h = player2.PlayerGui:FindFirstChild("Changing Map") if h then h:remove() end end print("Selecting new map...") wait(3) end
that should cut it |
|
|
| Report Abuse |
|
|