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: Localscript help

Previous Thread :: Next Thread 
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
11 May 2015 06:09 PM
This is a localscript inside a GUI. Basically it changes the player's appearance and walkspeed and health when they click a button.

The problem is, other players can't see that they changed appearance. What do I do?

The script:

function Click()
local Shirts = {219289172,219288483,219287908,219289759}
local a = math.random(1,4)
local t = game.Players.LocalPlayer.Character:FindFirstChild('Shirt')
if t ~= nil then
local RandomMath = math.random
t.ShirtTemplate = "rbxassetid://"..Shirts[a]..""
game.Players.LocalPlayer.Character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=216640141"
else
local shirt = Instance.new("Shirt")
shirt.Name = "Shirt"
shirt.ShirtTemplate = "rbxassetid://"..Shirts[a]..''
shirt.Parent = game.Players.LocalPlayer.Character
game.Players.LocalPlayer.Character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=216640141"
end
end
script.Parent.MouseButton1Down:connect(Click)
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
11 May 2015 06:10 PM
Define Character.

Indent.

Define the variables you can OUTSIDE the function.

Then maybe i will help.
Report Abuse
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
11 May 2015 06:11 PM
Here ya go, arrogant.

function Click()

local Shirts = {219289172,219288483,219287908,219289759}
local a = math.random(1,4)
local t = game.Players.LocalPlayer.Character:FindFirstChild('Shirt')

if t ~= nil then
local RandomMath = math.random
t.ShirtTemplate = "rbxassetid://"..Shirts[a]..""
game.Players.LocalPlayer.Character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=216640141"

else
local shirt = Instance.new("Shirt")
shirt.Name = "Shirt"
shirt.ShirtTemplate = "rbxassetid://"..Shirts[a]..''
shirt.Parent = game.Players.LocalPlayer.Character
game.Players.LocalPlayer.Character.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=216640141"
end
end

script.Parent.MouseButton1Down:connect(Click)
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
11 May 2015 06:12 PM
Lol

"Define character"

"Define what you can OUTSIDE the function"

lolllllllllllll
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
11 May 2015 06:13 PM
Ok here ill do it 4 uuuuuuuuuuuu


im not arrogant, i like helpnig
Report Abuse
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
11 May 2015 06:13 PM
I realize my code is messy, but I just want help, not a reformat lesson.
Report Abuse
vectorGunner is not online. vectorGunner
Joined: 23 Mar 2014
Total Posts: 784
11 May 2015 06:14 PM
Sounds like a filtering enabled issue. You'll want to request the server to change their clothes. You can manage this using RemoteFunctions / RemoteEvents.

As for you TheNewChicken, you yourself need a lot of help so I highly doubt you're even fit to help. So how about you go lurk your posts hoping someone will help you rather than harassing others. Don't worry though, if somebody needs help with a kill brick I'll make sure to let you help first.
Report Abuse
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
11 May 2015 06:15 PM
I'm not familiar with remove functions at all.
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
11 May 2015 06:18 PM
Oh really im not fit? Take a look, gunner.

-- untested but should work.

repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character
local ShirtIDs = {0000,0000,0000,0000}

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()

math.randomseed(tick())
script.Parent.MouseButton1Down:connect(function()
local RandomShirtID = ShirtIDs[math.random(1,#ShirtIDs)]
for _,v in pairs(Character:GetChildren()) do
if v:IsA("Shirt") then
v:Destroy()
end
end
local Shirt = Instance.new("Shirt",Character)
Shirt.Name = "Shirt"
Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..RandomShirtID
end)
Report Abuse
mycheeze is online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
11 May 2015 06:19 PM
local P = game.Players.LocalPlayer
local C = P.Character or P.CharacterAdded:wait()
local Shirts = {219289172,219288483,219287908,219289759}


script.Parent.MouseButton1Down:connect(function()
local N = math.random(1, #Shirts)
for _,_ in pairs (C:GetChildren()) do
if _:IsA'Shirt' or _:IsA'Pants' then _:Destroy() end end wait()
local S, P = Instance.new('Shirt', C), Instance.new('Pants', C)
S.Name, S.ShirtTemplate = 'Shirt', 'rbxassetid://'..Shirts[N]..''
P.Name, P.PantsTemplate = 'Pants', 'rbxassetid://216640141'
end)

kek
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
11 May 2015 06:21 PM
Wait, i forgot to minus 1. The fixed version:

local ShirtIDs = {219289172,219288483,219287908,219289759}

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()

math.randomseed(tick())
script.Parent.MouseButton1Down:connect(function()
local RandomShirtID = ShirtIDs[math.random(1,#ShirtIDs)]
for _,v in pairs(Character:GetChildren()) do
if v:IsA("Shirt") then
v:Destroy()
end
end
local Shirt = Instance.new("Shirt",Character)
Shirt.Name = "Shirt"
Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..RandomShirtID-1
end)
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
11 May 2015 06:22 PM
Assuming you didnt already minus 1? If so, just remove the minus 1 at the end or add a 1 to each ID. Sorry for the inconvience
Report Abuse
vectorGunner is not online. vectorGunner
Joined: 23 Mar 2014
Total Posts: 784
11 May 2015 06:22 PM
They're pretty simple.

You'll want one in ReplicatedStorage ( a remotefunction instance )
The first argument in every RemoteFunction invoke is the client ( the player who sent the request ) just so you know.

--ServerScript
function RemoteFunction.OnServerInvoke(Client, shirtId) --stuff
--change character and what not
end

--ClientScript
--however you fire the clothing change now
RemoteFunction:InvokeServer(shirtId) --idk what your parameters are anymore
--end of the function that fires clothing change
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
11 May 2015 06:24 PM
Didnt realise he had FE on. Well, i did. It just didnt register.

Use a remote event to call it both locally and serverally (is that a word?)
Report Abuse
vectorGunner is not online. vectorGunner
Joined: 23 Mar 2014
Total Posts: 784
11 May 2015 06:25 PM
Please mycheez and TheNewChicken just leave. You obviously didn't read his post. The issue is obviously filtering enabled after just thinking for a moment. God idiots!
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
11 May 2015 06:27 PM
Were not idiots, we just didnt realise. Also, i helped and made it better.

Now i am going to report, you hurt my feelings.
Report Abuse
mycheeze is online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
11 May 2015 06:27 PM
@vec, I came 2 revise his messy code, that they openly admitted was messy ;~;

Then there's you, you came to be butthurt, which last time I recall, wasn't asked 4
Report Abuse
vectorGunner is not online. vectorGunner
Joined: 23 Mar 2014
Total Posts: 784
11 May 2015 06:32 PM
You revised code hes going to have to scrap just to make a remotefunction version anyways. Wow, a real hero. I realize how out of line I was now. ( sarcasm overflow )
Report Abuse
mycheeze is online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
11 May 2015 06:35 PM
List N. vector bb, I only hate you because you have the fugly green that is the devil's morning dump.

the devil's porridge is still red tho
Report Abuse
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
11 May 2015 06:37 PM
Ok so you're saying this won't work?

local ShirtIDs = {219289172,219288483,219287908,219289759}

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()

math.randomseed(tick())
script.Parent.MouseButton1Down:connect(function()
local RandomShirtID = ShirtIDs[math.random(1,#ShirtIDs)]
for _,v in pairs(Character:GetChildren()) do
if v:IsA("Shirt") then
v:Destroy()
end
end
local Shirt = Instance.new("Shirt",Character)
Shirt.Name = "Shirt"
Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id="..RandomShirtID-1
end)
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
11 May 2015 06:37 PM
you failed
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
11 May 2015 06:38 PM
It works just convert it to work with FE
Report Abuse
mycheeze is online. mycheeze
Joined: 27 Jun 2011
Total Posts: 6748
11 May 2015 06:38 PM
@Under, no that one works, just make sure you don't have filtering enabled set to true, and if you do, make a remote event to get this done globally rather than locally.

<3
Report Abuse
vectorGunner is not online. vectorGunner
Joined: 23 Mar 2014
Total Posts: 784
11 May 2015 06:38 PM
I won't say any of their scripts won't work. I don't have the time or effort to look into either of them. What I can say however is they don't solve the issue you came here with. Assuming my hypothesis on filtering enabled is accurate.
Report Abuse
UnderWorldOnline is not online. UnderWorldOnline
Joined: 31 Dec 2010
Total Posts: 7883
11 May 2015 06:39 PM
So what you're saying is, if I set filtering enabled to false (which I hope does not break anything), then it would work fine?
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