CoolArik1
|
  |
| Joined: 18 Sep 2011 |
| Total Posts: 59 |
|
|
| 23 Nov 2013 02:03 PM |
The script works like this:
local o = Instance.new("Script") o.Parent = game.Workspace.Baseplate.Part o.Source = [[ function onTouched(hit) if not hit or not hit.Parent then return end local human = hit.Parent:findFirstChild("Humanoid") if human and human:IsA("Humanoid") then human.Health = 0 Instance.new('Fire', human.Parent.Head).Name = "Burn" Instance.new('Fire', human.Parent.Torso).Name = "Burn" Instance.new('Fire', human.Parent["Right Arm"]).Name = "Burn" Instance.new('Fire', human.Parent["Left Arm"]).Name = "Burn" Instance.new('Fire', human.Parent["Right Leg"]).Name = "Burn" Instance.new('Fire', human.Parent["Left Leg"]).Name = "Burn" human.Parent.Head.Burn.Size = 10 human.Parent.Torso.Burn.Size = 10 human.Parent["Right Arm"].Burn.Size = 10 human.Parent["Left Arm"].Burn.Size = 10 human.Parent["Right Leg"].Burn.Size = 10 human.Parent["Left Leg"].Burn.Size = 10 end end
script.Parent.Touched:connect(onTouched) ]]
Anyone know what I did wrong? Thanks in advance! |
|
|
| Report Abuse |
|
|
CoolArik1
|
  |
| Joined: 18 Sep 2011 |
| Total Posts: 59 |
|
|
| 23 Nov 2013 02:04 PM |
Oh sorry I can't find a edit button, but the error happens on the line with
]]
Otherwise the last line. Sorry. |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2013 02:05 PM |
Script.Source is rbxlocked
Use loadstring() and StringValues instead. |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2013 02:06 PM |
| Or you can copy a disabled version of the script from elsewhere and then enable it in the player. |
|
|
| Report Abuse |
|
|
| |
|
CoolArik1
|
  |
| Joined: 18 Sep 2011 |
| Total Posts: 59 |
|
|
| 23 Nov 2013 02:07 PM |
| Oh. I didn't know source was locked. But how would I use loadstring() and StringValues? |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2013 02:09 PM |
str=Instance.new("StringValue",workspace) str.Value="" loadstring(str.Value)() |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2013 02:10 PM |
It is recommended to always use pcall with loadstring, in case the string errors. That way it wont break the script calling it.
pcall(loadstring("--your code here"))
Never Trust Roblox. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 23 Nov 2013 02:17 PM |
| I mean Roblox Studio. It does some really weird stuff...Never trust that something has been done successfully if you don't have complete control over its implementation. Even then Roblox sometimes treats integers as strings and crazy trippy stuff like that. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Nov 2013 02:17 PM |
No, just no. There is no such thing as an integer in Lua. |
|
|
| Report Abuse |
|
|
CoolArik1
|
  |
| Joined: 18 Sep 2011 |
| Total Posts: 59 |
|
|
| 23 Nov 2013 02:26 PM |
| Sadly I am new to LUA, so I can't figure out how the string works. I pasted the code and put tabs to separate lines since it would only go on one line. I feel bad for asking but may you please take this code and make it work in a string? Thanks again! |
|
|
| Report Abuse |
|
|
| |
|
CoolArik1
|
  |
| Joined: 18 Sep 2011 |
| Total Posts: 59 |
|
|
| 23 Nov 2013 02:31 PM |
| Lua is a scripting code and I think it is what roblox uses. I could be wrong though. (I usually am wrong.) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Nov 2013 02:38 PM |
| It's a scripting language and roblox does in fact, use a version of Lua |
|
|
| Report Abuse |
|
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 23 Nov 2013 02:42 PM |
| It isn't, but we all knew what he was talking about. |
|
|
| Report Abuse |
|
|