|
| 19 Oct 2013 09:15 PM |
I spent a lot of time making this and it's not working. What is wrong? ------------------------------------------------------------------------------------------- local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) local brick = workspace.questbrick1 local brickActive = true local stats = Player:FindFirstChild('leaderstats') if not stats then return end local money = stats:FindFirstChild('Money') if not money then return end brick.Touched:connect(function(Hit) if not brickActive then return end local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) if Player and Player:findFirstChild("PlayerGui") then brickActive = false Player.PlayerGui.ScreenGui1.Frame.Visible = true local yes = Player.PlayerGui.ScreenGui1.Frame.button1 local no = Player.PlayerGui.ScreenGui1.Frame.button2 local gui3 = Player.PlayerGui.ScreenGui3 function onClicked(yes) gui3.TextButton.Text = "Quest: Get 3 pieces of wood and a hammer and talk to the explorer." Player.PlayerGui.ScreenGui1.Frame1.Visible = false end yes.MouseClick:connect(onClicked) Player.PlayerGui.ScreenGui1.Frame2.Visible = true local yes1 = Player.PlayerGui.Frame2.button1 function onClicked(yes1) if Player.PlayerGui.woodvalue.Value >= 3 then Player.PlayerGui.woodvalue.Value = Player.PlayerGui.woodvalue.Value - 3 Money.Value = Money.Value + 100 Player.PlayerGui.ScreenGui1.Frame2.Visible = false end yes1.MouseClick:connect(onClicked) end function onClicked(no) Player.PlayerGui.ScreenGui1.Frame1.Visible = false end no.MouseClick:connect(onClicked) brickActive = true end end) ---------------------------------------------------------------------- Help? |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2013 09:19 PM |
| And I'm gonna spend a lot of time on this if you don't post the output ty. |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2013 09:20 PM |
| Hmm, seems like 'hit' isn't a valid value... I don't understand... |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2013 09:20 PM |
Output: local Player = game.Players:GetPlayerFromCharacter(Hit.Pare:1: attempt to index global 'Hit' (a nil value) 04:16:38.598 - Script 'local Player = game.Players:GetPlayerFromCharacter(Hit.Pare', Line 1 04:16:38.599 - stack end |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2013 09:22 PM |
| What do you mean output? What it is supposed to do? |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2013 09:24 PM |
| It says what the problem is... Nor really so good but it tells you what line that is wrong... |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Oct 2013 09:30 PM |
Output: local Player = game.Players:GetPlayerFromCharacter(Hit.Pare:1: attempt to index global 'Hit' (a nil value) 04:16:38.598 - Script 'local Player = game.Players:GetPlayerFromCharacter(Hit.Pare', Line 1 04:16:38.599 - stack end |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2013 09:31 PM |
Look up line 1... It says it is something wrong with it... I can't tell what... (Maybe 10 too, since it's the same). Well, I don't know anything about scripting, I can't even make a teleport script...
attempt to index global 'Hit' (a nil value)
~Take some beans and stay calm. |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Oct 2013 10:09 PM |
local brick = workspace.questbrick1 local brickActive = true brick.Touched:connect(function(Hit) local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) local stats = Player:FindFirstChild('leaderstats') if not stats then return end local money = stats:FindFirstChild('Money') if not money then return end if Player and Player:findFirstChild("PlayerGui") then brickActive = false Player.PlayerGui.ScreenGui1.Frame.Visible = true local yes = Player.PlayerGui.ScreenGui1.Frame.button1 local no = Player.PlayerGui.ScreenGui1.Frame.button2 local gui3 = Player.PlayerGui.ScreenGui3 function onClicked(yes) gui3.TextButton.Text = "Quest: Get 3 pieces of wood and a hammer and talk to the explorer." Player.PlayerGui.ScreenGui1.Frame1.Visible = false end yes.MouseClick:connect(onClicked) Player.PlayerGui.ScreenGui1.Frame2.Visible = true local yes1 = Player.PlayerGui.Frame2.button1 function onClicked(yes1) if Player.PlayerGui.woodvalue.Value >= 3 then Player.PlayerGui.woodvalue.Value = Player.PlayerGui.woodvalue.Value - 3 Money.Value = Money.Value + 100 Player.PlayerGui.ScreenGui1.Frame2.Visible = false end yes1.MouseClick:connect(onClicked) end function onClicked(no) Player.PlayerGui.ScreenGui1.Frame1.Visible = false end no.MouseClick:connect(onClicked) brickActive = true end end)
What is your favorite ROBLOX game genre? Go here to take the survey!: goo(DOT)gl/3U8zNK |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2013 10:13 PM |
logging probability 0.80837427900021 not logging 20:12:41.289 - DataModel Loading roblox.com/asset/?id=(somenumber) Streaming Memory Multiplier Loaded |
|
|
| Report Abuse |
|
|
|
| 19 Oct 2013 10:15 PM |
That's not a bad output. So I would have no idea what's wrong.
What is your favorite ROBLOX game genre? Go here to take the survey!: goo(DOT)gl/3U8zNK <-- sig |
|
|
| Report Abuse |
|
|