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: What could be wrong with this? *No output, sorry*

Previous Thread :: Next Thread 
PompeyTheGreat is not online. PompeyTheGreat
Joined: 10 Apr 2011
Total Posts: 5615
13 Nov 2011 12:18 PM
So I'm making this kind of admin thing where a truss follows you, kind of like a minion. The truss is created and all that, but the truss just stays under the baseplate. The chat doesn't work either. Anyone find a problem in my code?


----------

local player = "PompeyTheGreat"
local truss = Instance.new("TrussPart", Workspace)
local bp = Instance.new("BodyPosition", truss)
local wire = Instance.new("FloorWire", truss)
bp.maxForce = Vector3.new(40000,40000,40000)
wire.Color = BrickColor.new("Bright red")
wire.TextureSize = Vector2.new(5,5)
wire.Transparency = .1
wire.StudsBetweenTextures = 1
wire.Velocity = 1

coroutine.resume(coroutine.create(function()
while wait() do
plr = game.Players:FindFirstChild(player)
if plr then
repeat wait() until plr.Character
bp.position = plr.Character.Torso.Position + Vector3.new(5,0,0)
end end
end))

function locate(name)
    for _, player in pairs(game.Players:GetPlayers()) do
        if string.find(player.Name:lower(), name:lower()) == 1 then
            return player
        end
    end
    return nil
end

function wire(to, from, tex)
wire.To = to
wire.From = from
wire.Texture = tex
wait(2)
wire.To = nil
end

function script(so)
end

local chatter = game.Players:FindFirstChild(player)
if chatter then

chatter.Chatted:connect(function(message, speaker)

local msg = message:lower()

--player commands
if string.sub(msg, 1, 5) == "fire>" then
ply = locate(string.sub(msg, 6))
if ply ~= nil then
fi = Instance.new("Fire")
fi.Parent = game.Players:FindFirstChild(ply.Name).Character.Torso
fi.Name = "Flame"
end end

end)
end
Report Abuse
PompeyTheGreat is not online. PompeyTheGreat
Joined: 10 Apr 2011
Total Posts: 5615
13 Nov 2011 12:22 PM
Nevermind, the chat command works, but the truss still spawns under the base :-/
Report Abuse
abx1 is not online. abx1
Joined: 13 Nov 2008
Total Posts: 4979
13 Nov 2011 12:23 PM
Under your definition of "bp" place it again.

plr = game.Players:FindFirstChild(player)
bp.position = plr.Character.Torso.Position + Vector3.new(5,0,0)

That should work.
Report Abuse
PompeyTheGreat is not online. PompeyTheGreat
Joined: 10 Apr 2011
Total Posts: 5615
13 Nov 2011 12:30 PM
I fixed it, it was pretty simple actually.

i embarrassed
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