keehl254
|
  |
| Joined: 08 Sep 2010 |
| Total Posts: 131 |
|
|
| 29 Feb 2012 10:10 PM |
Im trying to make a dialog guy you can talk too, and he will let you takeover the flag (Its for a fort.) Anyways i want it so the text (hint(not really a hint, a gui label.)) will show up on everyone's screen.
I want for a person to take over the base and for the text to show up on everyones gui. If you can help me with this, then thank you. It's kinda a huge script.
local win = false local currown local raidtime = 0 local bodtime = 0 local plrtype local bricks = script.Parent.Parent.Parent.xS:children() local center = script.Parent.Parent.Parent.Center local children = game.Players:GetChildren()
function Time(o) while o == currown do if currown == "Raiders" then wait(3) if bodtime > 0 then bodtime = bodtime - 1 for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "Losing: SNAC " .. tostring(bodtime) .. "%!" end print("well were losing xD") elseif bodtime == 0 and raidtime < 100 then wait(3) raidtime = raidtime + 1 for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "Winning: ~Raiders~ " .. tostring(raidtime) .. "%!" end elseif raidtime == 100 then for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "Raiders have won!" end win = true wait(15) win = false raidtime = 0 bodtime = 0 currown = nil for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "No one has the base." end end elseif currown == "SNAC" then wait(3) if raidtime > 0 then raidtime = raidtime - 1 for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "Losing: ~Raiders~ " .. tostring(raidtime) .. "%!" end elseif raidtime == 0 and bodtime < 100 then wait(6) bodtime = bodtime + 1 for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "Winning: SNAC " .. tostring(bodtime) .. "%!" end elseif bodtime == 100 then for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "SNAC has won!" end win = true wait(15) win = false raidtime = 0 bodtime = 0 currown = nil for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "No one has the base." end end end end return end
function Claim() for i = 1, 34 do wait() center.Mesh.Scale = Vector3.new(3+(i/2),3+(i/2),3+(i/2)) end for i = 0, 10, 1 do wait() center.Reflectance = (i/10) end if plrtype == 1 then currown = "Raiders" for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "Raiders have captured the Flag!" end center.BrickColor = game.Teams.Raiders.TeamColor for i = 1, #bricks do bricks[i].BrickColor = game.Teams.Raiders.TeamColor end elseif plrtype == 0 then currown = "SNAC" for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "SNAC has captured the Flag!" end center.BrickColor = BrickColor.new("Bright red") for i = 1, #bricks do if bricks[i].Name == "Red" then bricks[i].BrickColor = BrickColor.new("Bright red") elseif bricks[i].Name == "Really black" then bricks[i].BrickColor = BrickColor.new("Really black") end end end for i = 10, 0, -1 do wait() center.Reflectance = (i/10) end for i = 34, 1, -1 do wait() center.Mesh.Scale = Vector3.new(3+(i/2),3+(i/2),3+(i/2)) end Time(currown) end
function onSelect(plr,x) if win == true then return end if x == script.Parent.Dialog.Check then if plr.TeamColor == game.Teams.Raiders.TeamColor then if currown == "Raiders" then script.Parent.Dialog.Check.Claim.ResponseDialog = "You already have the base." plrtype = 2 else script.Parent.Dialog.Check.Claim.ResponseDialog = "Claiming the base for Raiders." plrtype = 1 end else if currown == "SNAC" then script.Parent.Dialog.Check.Claim.ResponseDialog = "You already have the base." plrtype = 2 else script.Parent.Dialog.Check.Claim.ResponseDialog = "Claiming the base for SNAC." plrtype = 0 end end elseif x == script.Parent.Dialog.Check.Claim then if plrtype ~= 2 then Claim() end end end
script.Parent.Dialog.DialogChoiceSelected:connect(onSelect) |
|
|
| Report Abuse |
|
|
|
| 29 Feb 2012 10:14 PM |
What is wrong with it?
`*\~-{ Are we there yet T.T? }-~/*` |
|
|
| Report Abuse |
|
|
keehl254
|
  |
| Joined: 08 Sep 2010 |
| Total Posts: 131 |
|
|
| 29 Feb 2012 10:16 PM |
| I know right. Its so long that you can't even see the end. well anyways the thing thats wrong is that i can't get the text to show up on everybodys gui. Where it says hint = "" thats where the text is i want to show on the gui. Anyways, for some strange reason it isn't working. |
|
|
| Report Abuse |
|
|
keehl254
|
  |
| Joined: 08 Sep 2010 |
| Total Posts: 131 |
|
|
| 29 Feb 2012 10:17 PM |
| The output says that "character isn't a valid argument in PlayerGui"-- i really don't know what that means xD |
|
|
| Report Abuse |
|
|
|
| 29 Feb 2012 10:17 PM |
Which hint = ? The first one?
`*\~-{ Are we there yet T.T? }-~/*` |
|
|
| Report Abuse |
|
|
|
| 29 Feb 2012 10:18 PM |
Dude. Lua is case sensitive... Its Character Q.Q
`*\~-{ Are we there yet T.T? }-~/*` |
|
|
| Report Abuse |
|
|
|
| 29 Feb 2012 10:18 PM |
Wait, no! You need one more parent. You parented it to something INSIDE the player :P
`*\~-{ Are we there yet T.T? }-~/*` |
|
|
| Report Abuse |
|
|
keehl254
|
  |
| Joined: 08 Sep 2010 |
| Total Posts: 131 |
|
|
| 29 Feb 2012 10:20 PM |
| XD thank you. Thats something i probably never would have noticed. I scrambled for 2 hours on this before i posted on here. (literally 2 hours. A movie ended right when i posted. |
|
|
| Report Abuse |
|
|
|
| 29 Feb 2012 10:21 PM |
I am jsut as bored as always though :D
`*\~-{ Are we there yet T.T? }-~/*` |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2012 06:03 AM |
| Wow.. this is going to be hard |
|
|
| Report Abuse |
|
|
keehl254
|
  |
| Joined: 08 Sep 2010 |
| Total Posts: 131 |
|
|
| 01 Mar 2012 06:35 AM |
Not exactly hard if you find the parts, that i say don't work. For example:
for i = 1, #children do local hint = children[i].PlayerGui.flag.Frame.Label hint.Text = "SNAC has captured the Flag!" end
Thats where i want the guis on people screens(hint) should say "SNAC has captured the Flag!" For a strange reason, the whole script still works, just not that part. The guis don't change. |
|
|
| Report Abuse |
|
|
keehl254
|
  |
| Joined: 08 Sep 2010 |
| Total Posts: 131 |
|
|
| 01 Mar 2012 06:44 AM |
| Still i can't figure out this though. |
|
|
| Report Abuse |
|
|
Atken
|
  |
| Joined: 10 Sep 2010 |
| Total Posts: 338 |
|
|
| 01 Mar 2012 08:37 AM |
| The line were it says "for i = 1, #children do", Capitalize the "I", then the script would work more properly. |
|
|
| Report Abuse |
|
|
keehl254
|
  |
| Joined: 08 Sep 2010 |
| Total Posts: 131 |
|
|
| 01 Mar 2012 04:30 PM |
That didn't work either. Anyways, i'm trying a new way of it by just changing the text straight up. It's still not working, but i think is a little easier too work with.
for I = 1, #children do children[i].PlayerGui.flag.Framething.Label.Text = "Losing: SNAC " .. tostring(bodtime) .. "%!" end
|
|
|
| Report Abuse |
|
|