|
| 10 Jul 2016 11:59 PM |
local player = game:GetService("Players").LocalPlayer game.Workspace:WaitForChild(player.Name)
local d = game.Workspace[player.Name]:GetChildren()
for i=1, #d do if (d[i].className == "Part" and d[i].Name ~= "HumanoidRootPart") then --gets all parts in player d[i].Transparency = SPECTER_TRANSPARENCY --half visible d[i].BrickColor = BrickColor.new(SPECTER_COLOR) --player turns white end end
ty for the help!
https://www.roblox.com/Donald-Trump-Says-China-item?id=328461041 |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 12:08 AM |
This works in ROBLOX Studio as well...
https://www.roblox.com/Donald-Trump-Says-China-item?id=328461041 |
|
|
| Report Abuse |
|
|
| |
|
doggy00
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 3571 |
|
|
| 11 Jul 2016 12:10 AM |
I know sometimes if it works in studio but not in-game then it will work in-game by using a normal script rather than a local one, but you're probably using a local script for a reason so I don't know what to tell you.
--game.Players.doggy00.Life:remove() error- Life is not a valid member of Player |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 12:12 AM |
It has to be a local script because I have FE enabled...
https://www.roblox.com/Donald-Trump-Says-China-item?id=328461041 |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 12:17 AM |
FE is the cuase. just disable FE or you could use server script to do it if you want FE (You have to pass the LocalPlayer to the server) |
|
|
| Report Abuse |
|
|
doggy00
|
  |
| Joined: 11 Jan 2011 |
| Total Posts: 3571 |
|
|
| 11 Jul 2016 12:19 AM |
rem
--game.Players.doggy00.Life:remove() error- Life is not a valid member of Player |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 12:20 AM |
FE has to be on though, because I want the person who has the script to see themselves.
https://www.roblox.com/Donald-Trump-Says-China-item?id=328461041 |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 12:28 AM |
| so your script is to make the character only visible on the player's client? |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 12:30 AM |
Yes.
https://www.roblox.com/Donald-Trump-Says-China-item?id=328461041 |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 01:01 AM |
Bump...
https://www.roblox.com/Donald-Trump-Says-China-item?id=328461041 |
|
|
| Report Abuse |
|
|
njesk12
|
  |
| Joined: 21 Aug 2012 |
| Total Posts: 65 |
|
|
| 11 Jul 2016 01:44 AM |
Your problem here is that you are attempting to change server-side values with a local script... with FE enabled. Here's what you should do. Anything in your script that changes you character should be placed in a global script who's parent is the Workspace, and has a remote event child. Now you simply call the remote event and fire the server. Create an OnServerEvent function from the local script and allow the global scripts to make the changes instead.
You have to remember that a local script is LOCAL and can only change LOCAL attributes, whereas a GLOBAL script can change GLOBAL attributes. This is especially important to know when having FE. If you need help with more of this, learn more about Remote Events and Remote Functions here: http://wiki.roblox.com/index.php?title=RemoteFunction_and_RemoteEvent_Tutorial
Also, watch this video which helped me A LOT when I first began learning LUA: https://www.youtube.com/watch?v=C0qQ4lDa3t0 |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2016 01:54 AM |
I'll rewrite this because I'm bored. Make sure there is a RemoteEvent in ReplicatedStorage named "SpecterChange".
--A regular script in ServerScriptService. local rep = game:GetService("ReplicatedStorage") local change = rep:WaitForChild("SpecterChange")
change.OnServerEvent:connect(function(plr) change:FireAllClients(plr) end)
--A localscript in StarterPlayerScripts local rep = game:GetService("ReplicatedStorage") local change = rep:WaitForChild("SpecterChange")
local function ChangeCharacter(player) if (not player.Character or player == game:GetService("Players").LocalPlayer) then return end
for i, v in pairs(player.Character:GetChildren()) do if (v:IsA("BasePart")) then v.Transparency = 0.5 v.Color = Color3.new(255,255,255) end end end
change.OnClientEvent:connect(ChangeCharacter)
[SOMEWHERE ELSE]: change:FireServer() --Note the player fireing the FireServer will be the specter and this code isn't tested.
If money grew on trees... It would be as valuable as leaves. | Twitter: @TwisterRBLX
|
|
|
| Report Abuse |
|
|