| |
|
|
| 12 Jun 2015 05:45 PM |
How do i make it so that the fire balls come onto your left hand?
UIS.InputBegan:connect(function(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.X then local part = Instance.new("Part") part.Parent = hit.Parent."LeftArm" part.Shape = "Ball" part.BrickColor = BrickColor.new("Really red") part.Anchored = true Instance.new("Fire", part) end end) end)
LeBlanc true assassin http://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=41451881 |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 05:47 PM |
Here's a start :)
local plr = game.Players.LocalPlayer
UIS.InputBegan:connect(function(input, gameProcessedEvent) if input.KeyCode == Enum.KeyCode.X then local part = Instance.new("Part", workspace) part.Shape = "Ball" part.BrickColor = BrickColor.new("Really red") part.Anchored = true Instance.new("Fire", part) end end)
You might wanna go to the wiki and read about Velocity, BodyForce and BodyVelocity if you wanna make the ball fly :) |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 05:47 PM |
Thanks man ! :D
LeBlanc true assassin http://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=41451881 |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 06:15 PM |
If I have a LocalScript, and I need to use WaitForChild, what is the correct way to do that?
local Something = Something:WaitForChild("SomethingElse"):WaitForChild("AnotherThing") local Something = Something:WaitForChild("SomethingElse").AnotherThing |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 06:20 PM |
The first looks more reliable but I'd encourage in writing your game in a way that doesn't require waiting for any instances.
Example case: 1. Load map 2. Wait until youre sure the map is loaded (Optional 3: Wait for assets aswell) 3. Run all code that handles level stuff
You should then be fine since the instances are already set up and dont need to be waited for
|
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 06:21 PM |
local TRUE, FALSE = true, false local WAIT = wait local System = {} System.out = {} System.out.println = print
while TRUE do
System.out.println("lol")
WAIT(1)
end
PLEASE HELP ME! WHAT IS WRONG WITH MY SCRIPT?! |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 06:44 PM |
| Cody. You're a talented scripter, I know you're trolling. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 06:48 PM |
"Example case: 1. Load map 2. Wait until youre sure the map is loaded (Optional 3: Wait for assets aswell) 3. Run all code that handles level stuff
You should then be fine since the instances are already set up and dont need to be waited for"
I don't understand. Firstly, there isn't really a map yet, I'll worry about that later. Second, don't LocalScripts need WaitForChild so that accessing descendants doesn't error the first time?
Thanks for the reminder about the preloading, I forgot about that entirely. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 06:50 PM |
@Drakonking10 How nice and kinky. I am not trolling. Every time I System.out.println() it doesn't print to my Java console! |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 07:11 PM |
"Second, don't LocalScripts need WaitForChild so that accessing descendants doesn't error the first time?"
Depends on how you do it.
You could also have a manager script on the clientside that respectively waits for the map/game to be loaded on the serverside.
After it is loaded, run your clientside code. (preferrably modules since theyre easy to work with but enabling localscripts should work fine as well).
Then your 9241 localscripts don't need to wait for a specific object in every single one of them.
I know this didn't answer the question "how to properly wait for instances" but to be honest I haven't figured out a solid answer to that question, that works on 100% of cases.
Even in my framework I just wait an obscure amount of seconds and assume stuff is loaded. The time it waits is way more than it actually takes to load to keep it safe. Not the best way, not even a good way, but it works for now.
Framework & instance waiting code I mentioned: https://github.com/Elmuti/Orakel/blob/master/Client/GameClient.lua#L41 |
|
|
| Report Abuse |
|
|
gulfck22
|
  |
| Joined: 15 Nov 2010 |
| Total Posts: 3 |
|
|
| 12 Jun 2015 07:18 PM |
I cant get my bot to following someone the script is.
wait(1) follow = false
while true do if game.Players.Player1.Character.Torso ~= nil then if game.Players.Player1.Character.Torso.Position.X - game.Workspace.NPC.Torso.Position.X <= 10 then follow = true end end if follow then game.Workspace.NPC.Humanoid.WalkToPoint = game.Workspace.NPC.Torso.Position end wait(.5) end
|
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 07:22 PM |
| Cody. I thought you were talking about roblox. So thats why I said you were trolling since system.printIn() is not a real piece of lua code. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 07:58 PM |
"waits for the map/game to be loaded on the serverside." But it's already loaded on the server. The client takes a much longer time to load things than the server does; things need to be streamed, verified, and re-streamed if a packet errs. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 07:59 PM |
| Thanks for the help though, you could easily be right :P I just don't like it... |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 08:16 PM |
| A cool way to go about loading is tree your whole game and occlude all of the scripts. The scripts should be stored in ServerStorage. The parts should be in workspace. After the parts load, you can insert all scripts where they need to be. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 08:19 PM |
An even cooler way is to stream it from your web server, which streams it from your desktop. Then the server needs to get a file streamed from a file streamed, and clients need to have 1.5 times that. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 09:36 PM |
| wanna try my problem with in game voting since nobody can see my games in a game universe |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2015 09:39 PM |
Here ill draw a picture of what I meant. In on touch thing.
V Puck V brick V Goes through brick () ---> | ------> Code only works if puck hits that side of brick
It doesn't work if it goes through brick like that <---| <---- () |
|
|
| Report Abuse |
|
|
jbjgang2
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 8948 |
|
|
| 12 Jun 2015 09:40 PM |
i need help finding my children i think their lost can u get them for me
Swaggin' Since 2010 |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Jun 2015 09:41 PM |
Why is my bytes to double function wrong in certain cases? prntscr/7g8gh9 |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Jun 2015 10:00 PM |
| Never mind I answered my own question along time ago -.- subnormals ain't handled. |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2015 03:52 AM |
@jbjgang2
local Brick = game.Workspace.Brick
local onHit = function(hit)
if(hit.Position.X < Brick.Position.X)then --if hit on lefter side of the world
elseif(hit.Position.X > Brick.Position.X)then --if hit on righter side of the world
elseif(hit.Position.Z < Brick.Position.Z)then --if hit on backer side of the world
elseif(hit.Position.Z > Brick.Position.Z)then --if hit on fronter side of the world
end
end
Brick.Touched:connect(onHit)
| __|__ | | | | | |< if part was here right here... __|__|__|___ elseif(hit.Position.X > Brick.Position.X)then would run | | | | | | |__|__| | |
|
|
|
| Report Abuse |
|
|