|
| 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 |
|
|
| 13 Nov 2011 12:22 PM |
| Nevermind, the chat command works, but the truss still spawns under the base :-/ |
|
|
| Report Abuse |
|
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 |
|
|
| 13 Nov 2011 12:30 PM |
I fixed it, it was pretty simple actually.
i embarrassed |
|
|
| Report Abuse |
|