generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: 2 Problems

Previous Thread :: Next Thread 
TellerMan is not online. TellerMan
Joined: 23 Apr 2010
Total Posts: 237
04 Jul 2013 11:38 AM
I am trying to make a RPG quest and GUI... And it checks when you kill a bandit...
Well it should. First the checking script doesnt seem to do anything. Second this error pops up for this script in the GUI.

First Script -

while script.Parent ~= nil do
if script.Parent.Humanoid.Health < 1 then
print("Part 1/5 Done!")
function onQuest(player)
print("Part 2/5 Done!")
if script.Parent.Parent == player then
print("Part 3/5 Done!")
local name = player.Name
local Player = game.Players:findFirstChild(name)
if Player ~= nil then
print("Part 4/5 Done!")
local questGui = Player.PlayerGui.Objective
if questGui ~= nil then
print("Part 5/5 Done!")
local kills = questGui.Items
kills.Value = kills.Value + 1
print("YAY IT WOKRED!")
end
end
end
end
end
wait()
repeat wait() until script.Parent == nil
end



----------------------------------------------------------------------------------------------------------------
Second Script -

while true do
local kiwi = script.Parent.Items
local items = script.Parent.Item1
local done = false
items.Text = kiwi .. "/3"
if kiwi == 3 then
done = true
end
wait()
repeat wait() until done
end


[[[[[[[[For this script, output says:
12:36:08.561 - Players.Player1.PlayerGui.Objective.Items.ItemSensor:5: attempt to concatenate local 'kiwi' (a userdata value)
12:36:08.562 - Script "Players.Player1.PlayerGui.Objective.Items.ItemSensor", Line 5
12:36:08.563 - stack end]]]]]]



{{{{{SORRY FOR THE HUGE POST... it's just this is a huge problem and i want to fix it}}}}}}}}
Report Abuse
ukwarrior6 is not online. ukwarrior6
Joined: 06 Sep 2009
Total Posts: 485
04 Jul 2013 11:48 AM
local kiwi = script.Parent.Items -- group?
local items = script.Parent.Item1
local done = false
items.Text = kiwi .. "/3" -- basically, doesn't like this, the "kiwi" value has to be a string


Possible Solutions?

local kiwi = script.Parent.Items.Name --might be what you want
local items = script.Parent.Item1
local done = false
items.Text = kiwi .. "/3

local kiwi = script.Parent.Items.Value --If it's a StringValue etc..
local items = script.Parent.Item1
local done = false
items.Text = kiwi .. "/3
Report Abuse
TellerMan is not online. TellerMan
Joined: 23 Apr 2010
Total Posts: 237
04 Jul 2013 11:57 AM
Oh thanks, I realized I needed the value. Items is a NumValue.

while true do
local kiwi = script.Parent.Items
local items = script.Parent.Item1
local done = false
items.Text = kiwi.Value .. "/3"
if kiwi.Value == 3 then
done = true
end
wait()
repeat wait() until done
end
Report Abuse
TellerMan is not online. TellerMan
Joined: 23 Apr 2010
Total Posts: 237
04 Jul 2013 12:16 PM
This script still does not work though!
I realized I had to call/connect the function so that it would execute but what next?

while script.Parent ~= nil do
local Humanoid = script.Parent.Humanoid
if Humanoid.Health < 1 then
print("Part 1/5 Done!")
function onQuest(player)
print("Part 2/5 Done!")
if script.Parent.Parent == player then
print("Part 3/5 Done!")
local name = player.Name
local Player = game.Players:findFirstChild(name)
if Player ~= nil then
print("Part 4/5 Done!")
local questGui = Player.PlayerGui.Objective
if questGui ~= nil then
print("Part 5/5 Done!")
local kills = questGui.Items
kills.Value = kills.Value + 1
print("YAY IT WOKRED!")
end
end
end
end
Humanoid.Died:connect(onQuest)
end
wait()
repeat wait() until script.Parent == nil
end
Report Abuse
ukwarrior6 is not online. ukwarrior6
Joined: 06 Sep 2009
Total Posts: 485
06 Jul 2013 04:53 AM
Try making

local Player = game.Players:findFirstChild(name)

to just Player, not local Player, that might solve it? Althouggh i'm unsure, does output not display anything?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image