Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
|
| 19 Aug 2014 10:17 AM |
Basically I want to let the cilent change the name of his/her tycoon but it doesn't work. Can you help me sort it out? There's an output I didn't understand btw, it did mention about this 'a nil value'.
Output Statement:
Players.Player1.PlayerGui.RenameGui.Frame.Button.LocalScrip:5: attempt to index global 'tycoon' (a nil value)
LocalScript:
P = game.Players.LocalPlayer
function Rename() tycoon = game.Workspace:FindFirstChild(P.Name.."'s Tycoon") tn = tycoon.TycoonName tycoon.Main:FindFirstChild("Tycoon").Name = P.Name.."'s "..script.Parent.Parent.RenameBox.Text script.Parent.Parent.Parent.Frame:TweenPosition(UDim2.new(0, -500, 0.5, 0), "Out", 2) for GuiReveal = 1, 0, -0.05 do P.PlayerGui.TycoonGui.Notice.Text = "You have now re-named your "..tn.Value..", "..P.Name.."!" P.PlayerGui.TycoonGui.Notice:TweenPosition(UDim2.new(0, 0, 0, 50), Out, Quad, 0.8, false) P.PlayerGui.TycoonGui.Notice.Transparency = GuiReveal wait() end wait(3) for GuiReveal = 0, 1, 0.15 do P.PlayerGui.TycoonGui.Notice:TweenPosition(UDim2.new(0, 0, 0, 50), Out, Quad, 0.8, false) P.PlayerGui.TycoonGui.Notice.Transparency = GuiReveal wait() end end
script.Parent.MouseButton1Down:connect(Rename)
|
|
|
| Report Abuse |
|
|
| |
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 19 Aug 2014 10:21 AM |
he posted the output e_e
you didn't make "tycoon" a local value
|
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 19 Aug 2014 10:22 AM |
"tycoon = game.Workspace:FindFirstChild(P.Name.."'s Tycoon") tn = tycoon.TycoonName"
local tycoon = game.Workspace:FindFirstChild(P.Name.."'s Tycoon") tn = tycoon.TycoonName
local tn = tycoon.TycoonName |
|
|
| Report Abuse |
|
|
Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
|
| 19 Aug 2014 10:22 AM |
'the output?'
Have you not used one in Roblox Studio before? You use the Output to check for problems with your scripts. |
|
|
| Report Abuse |
|
|
Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
|
| 19 Aug 2014 10:23 AM |
@Trip
Shall I put that into 'Script' instead of LocalScript? |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2014 10:24 AM |
Lol i didn't see the output
|
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 19 Aug 2014 10:24 AM |
| you're dealing with specific players, so no |
|
|
| Report Abuse |
|
|
Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
| |
|
Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
| |
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
| |
|
Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
|
| 19 Aug 2014 11:42 AM |
| Players.Player1.PlayerGui.RenameGui.Frame.Button.LocalScrip:5: attempt to index local 'tycoon' (a nil value) |
|
|
| Report Abuse |
|
|
Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
| |
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
| |
|
Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
|
| 19 Aug 2014 12:48 PM |
| Will anyone please help make my script a complete script? :/ |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2014 12:52 PM |
| Dude you put Scrip instead of script, in 2 places. |
|
|
| Report Abuse |
|
|
Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
|
| 19 Aug 2014 12:57 PM |
| No I didn't, the output just says. |
|
|
| Report Abuse |
|
|
Dushax
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 12892 |
|
| |
|