Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Not returning to function?

Asked by
drahsid5 250 Moderation Voter
11 years ago

Well, it seems I never get it right when it comes to returning to functions, so I'd like for you, my friends, to help me remember this. Basically what this script is, is a item equip script, for a horror game engine/framework I'm working on. When you hit F, the currently equipped light source should be welded too your arm. I scripted the functions before the KeyDown event. It doesn't seem to work, so I know I didn't recall the function right. Can anyone tell me what I'd done wrong? Code:

01<pre class="brush: lua">repeat wait() until game.Players.LocalPlayer --This is basically a anti-bug line.
02wait(1) --Not really needed.
03UseableAmmo = {[1] = script.NumTorches, [2] = script.LanternOil, [3] = script.FlashlightBattery} --A table, for my values
04print "Tables set"
05NumTorches = UseableAmmo[1] .Value
06LanternOil = UseableAmmo[2].Value
07FlashlightBattery = UseableAmmo[3].Value --I might not actually need .Value
08Using = script.Using
09Mouse = game.Players.LocalPlayer:GetMouse() --We need this
10print "Values set"
11Torch = {"Torch", NumTorches} --More tables.
12Lantern = {"Lantern",LanternOil}
13Flashlight = {"Flashlight", FlashlightBattery}
14print "Usable Light sources defined"
15wait()
View all 76 lines...
0
The tab button is a thing you know 25564 200 — 11y

1 answer

Log in to vote
0
Answered by 11 years ago
01--might just need to adjust ends a little bit
02 
03<pre class="brush: lua">repeat wait() until game.Players.LocalPlayer --This is basically a anti-bug line.
04wait(1) --Not really needed.
05UseableAmmo = {[1] = script.NumTorches, [2] = script.LanternOil, [3] = script.FlashlightBattery} --A table, for my values
06print "Tables set"
07NumTorches = UseableAmmo[1] .Value
08LanternOil = UseableAmmo[2].Value
09FlashlightBattery = UseableAmmo[3].Value --I might not actually need .Value
10Using = script.Using
11Mouse = game.Players.LocalPlayer:GetMouse() --We need this
12print "Values set"
13Torch = {"Torch", NumTorches} --More tables.
14Lantern = {"Lantern",LanternOil}
15Flashlight = {"Flashlight", FlashlightBattery}
View all 73 lines...
0
Hmm, that doesn't seem to have done anything, it still does nothing, while not outputting a error. drahsid5 250 — 11y
Ad

Answer this question