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 » Scripters
Home Search
 

Re: How do you create objects that only appear to the client?

Previous Thread :: Next Thread 
bigboy77584 is not online. bigboy77584
Joined: 06 Jan 2009
Total Posts: 1003
19 Aug 2015 11:14 AM
how?
Report Abuse
xlaser23 is not online. xlaser23
Joined: 10 Dec 2011
Total Posts: 20341
19 Aug 2015 11:18 AM
Local script

wiki.roblox.com



Great Glob and Apple Sauce
Report Abuse
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
19 Aug 2015 11:21 AM
You can create it with either a local script with Filtering Enabled
OR
create it with a local script and parent it to game.Workspace.CurrentCamera

while true do the do
Report Abuse
bigboy77584 is not online. bigboy77584
Joined: 06 Jan 2009
Total Posts: 1003
19 Aug 2015 11:31 AM
Neither of these worked. Here is a test I made in current camera in a local script:

local on = false
script.Parent = workspace.CurrentCamera
workspace.test.Touched:connect(function()
if not on and script.Parent:FindFirstChild("H")==nil then
local c = Instance.new("SelectionBox", workspace.test)
c.Adornee = workspace.test
c.Name = "H"
wait(1)
on = true
elseif on then
workspace.test:FindFirstChild("H"):Destroy()
on = false
end
end)

and with FilteringEnabled on in a local script:

local on = false
script.Parent.Touched:connect(function()
if not on then
local c = Instance.new("SelectionBox", script.Parent)
c.Name = "Hi"
c.Adornee = script.Parent
on = true
elseif on then
script.Parent:FindFirstChild("Hi"):Destroy()
on = false
end
end)

Neither of these worked and returned no errors.



Report Abuse
Bergan is not online. Bergan
Joined: 23 Nov 2007
Total Posts: 4942
19 Aug 2015 11:32 AM
I've achieved this by localscripts in a GUI that put/remove objects in the camera.

I define the camera as this:
local C = game.Workspace.CurrentCamera
Report Abuse
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
19 Aug 2015 11:33 AM
m8 u go like this
cam = game.Workspace.CurrentCamera
local part = Instance.new("Part",cam) --Only the local player can see this
part.Name = "Haha"


while true do the do
Report Abuse
bigboy77584 is not online. bigboy77584
Joined: 06 Jan 2009
Total Posts: 1003
19 Aug 2015 11:35 AM
local on = false
local A = workspace.CurrentCamera
workspace.test.Touched:connect(function()
if not on and script.Parent:FindFirstChild("H")==nil then
local c = Instance.new("SelectionBox", A)
c.Adornee = workspace.test
c.Name = "H"
wait(1)
on = true
elseif on then
A:FindFirstChild("H"):Destroy()
on = false
end
end)

Didn't work :(
Report Abuse
Bergan is not online. Bergan
Joined: 23 Nov 2007
Total Posts: 4942
19 Aug 2015 11:44 AM
Let me give you my example. This is my Local SkySphere script.

Firstly, this is the structure.

ScreenGui SkyEffect
>StringValue ColorValue
>ImageLabel Needle B (Remenant from a compass GUI I made)
|>LocalScript (Named as itself)
-|>Part SkyBlue
--|>Mesh (Named as itself; is an inverted sphere of size -2500 cubed)


wait (5)
while true do
wait(1)
local C = game.Workspace.CurrentCamera
local Sky = C:FindFirstChild("Sky")

if Sky == nil then
local New = script.SkyBlue:Clone()
New.Parent = C
New.Name = "Sky"
else

local Color = script.Parent.Parent.ColorValue.Value
local SkyBox = C.Sky

if Color == "Blue" then
Sky.BrickColor = BrickColor.New("Really blue")
Sky.Transparency = 0.5
Sky.Mesh.TextureId = ""
else if Color == "Red" then
Sky.BrickColor = BrickColor.New("Really red")
Sky.Transparency = 0.35
Sky.Mesh.TextureId = ""
else if Color == "Green" then
Sky.BrickColor = BrickColor.New("Lime green")
Sky.Transparency = 0.35
Sky.Mesh.TextureId = ""
else if Color == "Black" then
Sky.BrickColor = BrickColor.New("Really black")
Sky.Transparency = 0
Sky.Mesh.TextureId = "http://www.roblox.com/asset/?id=110490566" -- Brickcolor isn't dark enough.
else
Sky.BrickColor = BrickColor.New("Institutional white") -- Clear sky
Sky.Transparency = 1
Sky.Mesh.TextureId = ""
end
end
end
end
end

end
Report Abuse
lostend is not online. lostend
Joined: 21 Aug 2011
Total Posts: 8265
19 Aug 2015 11:47 AM
--put a remote event in replicatedstorage, name it trigger
--serverscript
local trigger=game:GetService'ReplicatedStorage':WaitForChild'trigger'

script.Parent.Touched:connect(function(hit)
trigger:FireClient(game:GetService'Players':FindFirstChild(hit.Parent.Name))
end)

--local script
local trigger=game:GetService'ReplicatedStorage':WaitForChild'trigger'
trigger.OnClientEvent:connect(function()
--part stuff here, should only replicate to client
end)


--Edit these to fit what you are doing
--im not sure if this will work. I havent used FE in a while
Report Abuse
Intern33t is not online. Intern33t
Joined: 19 Nov 2010
Total Posts: 1530
19 Aug 2015 11:48 AM
*rips face off and rethinking life*

Listen man. Learn to script.

This belongs in a localscript in StarterGui:

local part = Instance.new("Part", workspace.CurrentCamera)
--initialize the bricky stuff thingy
part.Touched:connect(function()
BeStupid()
end)
Report Abuse
bigboy77584 is not online. bigboy77584
Joined: 06 Jan 2009
Total Posts: 1003
19 Aug 2015 12:32 PM
@Intern33t Well... sorrryyyy I didn't know that LOCAL SCRIPTS went into a folder for GUIS when doing this...

Oh wait a minute... yeah lol...

Anyway, whenever I walk over the block with the selection box present, it will not go away and I don't think it is a problem with my script:

local on = false
local A = workspace.CurrentCamera
local part = Instance.new("Part", A)
part.Name = "test"
part.Position = Vector3.new(190.4, 27.5, -217.2)
part.Anchored = true
A.test.Touched:connect(function()
if not on and script.Parent:FindFirstChild("H")==nil then
local c = Instance.new("SelectionBox", A.test)
c.Adornee = A.test
c.Name = "H"
wait(1)
on = true
elseif on then
A.test:FindFirstChild("H"):Destroy()
on = false
end
end)
Report Abuse
bigboy77584 is not online. bigboy77584
Joined: 06 Jan 2009
Total Posts: 1003
19 Aug 2015 02:58 PM
bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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