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: Help?

Previous Thread :: Next Thread 
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 05:26 PM
game.Workspace.MouseButton1Click:connect(function(plr)
local name = plr.Name
local playerinplayers = game.Players:FindFirstChild(plr.Name)
if playerinplayers ~= nil then
playerinplayers.CanLoadCharacterAppearance = false
game.ServerStorage['Korblox Deathspeaker Left Arm']:Clone().Parent = plr
game.ServerStorage['Korblox Deathspeaker Right Arm']:Clone().Parent = plr
game.ServerStorage['Korblox Deathspeaker Left Leg']:Clone().Parent = plr
game.ServerStorage['Korblox Deathspeaker Right Leg']:Clone().Parent = plr
game.ServerStorage['Korblox Deathspeaker Torso']:Clone().Parent = plr
end
end)


I want to make this change packages when you click a TextButton, but it doesn't work. They're no errors.



#code -- Yes, I do realize I'm dressed like Flux_Capacitor deal with it.
Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 05:31 PM
bumping because only 2 views



#code -- Yes, I do realize I'm dressed like Flux_Capacitor deal with it.
Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 05:38 PM
Updated script:

script.Parent.MouseButton1Click:connect(function(plr)
local name = plr.Name
local playerinplayers = game.Players:FindFirstChild(plr.Name)
if playerinplayers ~= nil then
playerinplayers.CanLoadCharacterAppearance = false
game.ServerStorage['Korblox Mage Left Arm']:Clone().Parent = plr
game.ServerStorage['Korblox Mage Right Arm']:Clone().Parent = plr
game.ServerStorage['Korblox Mage Left Leg']:Clone().Parent = plr
game.ServerStorage['Korblox Mage Right Leg']:Clone().Parent = plr
game.ServerStorage['Korblox Mage Torso']:Clone().Parent = plr
end
end)

I also get a error when I click the button saying:
17:37:57.430 - Players.Player1.PlayerGui.ScreenGui.TextButton.MorphScript:2: attempt to index local 'plr' (a nil value)



#code -- Yes, I do realize I'm dressed like Flux_Capacitor deal with it.
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
23 Apr 2016 05:41 PM
--You need to link that to a clickdetector or somthing..
game.Workspace.MouseButton1Click:connect(function(p)--This won't work...
local playerinplayers = game.Players:FindFirstChild(p.Name)
local korblox = game.ServerStorage.Model--Put them in a model or somthing.
playerinplayers.CanLoadCharacterAppearance = false
for i,v in pairs(korblox:GetChildren()) do
v:Clone().Parent = p
end
end)
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
23 Apr 2016 05:42 PM
Whoops..
v:Clone().Parent = p.Character
Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 05:44 PM
The updated script has the new thing, it's a textButton, I can't link it to a ClickDetector



Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 05:45 PM
I Still gives me :

17:46:34.568 - Players.Player1.PlayerGui.ScreenGui.TextButton.MorphScript:2: attempt to index local 'p' (a nil value)



Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
23 Apr 2016 05:51 PM
If it's in a local script add this:

p = game.Players.LocalPlayer

If not add this:

p = script.Parent.Parent -- Ect.. until it is in the player
Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 05:55 PM
game.Workspace.ChildAdded:connect(function(p)--This won't work...
p = script.Parent.Parent.Parent.Parent.Players
local playerinplayers = game.Players:FindFirstChild(p.Name)
local korblox = game.ServerStorage.Model--Put them in a model or somthing.
playerinplayers.CanLoadCharacterAppearance = false
for i,v in pairs(korblox:GetChildren()) do
v:Clone().Parent = p.Character
end
end)

If this is not it and you have a working one, send me the model, or fix this one.



Report Abuse
Lecturous is not online. Lecturous
Joined: 17 Aug 2013
Total Posts: 1096
23 Apr 2016 06:04 PM
Woah, woah, woah there! Don't clone the limbs into the player because:

- You'll have to take all the old limbs out.
- If you take out the old limbs, the player will die and reset their appearance.

Instead, destroy the meshes the player has (in their limbs) and clone the mesh from the model into the player.
Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 06:11 PM
Not character meshes.



Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 06:20 PM
bump



Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 06:32 PM
bump



Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 06:45 PM
Really? Bump



Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 07:29 PM
bump



#code game.Workspace.YourMom.LastNight = true
Report Abuse
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
23 Apr 2016 07:31 PM
um

the script has no idea what tf you are trying to click
your bascially trying to click the workspace

game.Workspace.Part.SurfaceGui.TextButton.MouseButton1Click:connect(function()
Report Abuse
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
23 Apr 2016 07:32 PM
oop sorry

i was looking at the outdated one
Report Abuse
Alimegacorn is not online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
23 Apr 2016 07:34 PM
try doing it the hard way

game.ServerStorage['Korblox Mage Right Leg']:Clone().Parent = game.Players.LocalPlayer.Character.RightLeg
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
23 Apr 2016 08:05 PM
Is it a SurfaceGui in workspace that you're clicking?



Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 08:07 PM
No, It's a textbutton in screengui. ..

Updated Results:
game.Workspace.ChildAdded:connect(function(p)--This won't work...
p = script.Parent.Parent.Parent.Parent.Players
local playerinplayers = game.Players:FindFirstChild(p.Name)
local korblox = game.ServerStorage.Model--Put them in a model or somthing.
playerinplayers.CanLoadCharacterAppearance = false
for i,v in pairs(korblox:GetChildren()) do
v:Clone().Parent = p.Character
end
end)

Still doesn't work.



#code game.Workspace.YourMom.LastNight = true
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
23 Apr 2016 08:13 PM
Why are you even using TextButton if you're not doing anything locally?

if You're just trying to Clone this KorbloxPackage to everyPlayer then


-- RegularScript in ServerScriptService

local KorbloxModel = game.ServerStorage:WaitForChild(ModelName)

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
p.CanLoadCharacterAppearance = false
for _,Meshes in pairs(KorbloxModel) do
local newMesh = Meshes:Clone()
newMesh.Parent = character
end
end)
end)



Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 08:14 PM
No, I want it to change packages on a player when you click a textbutton.



#code game.Workspace.YourMom.LastNight = true
Report Abuse
eRanged is not online. eRanged
Joined: 15 Jun 2013
Total Posts: 9746
23 Apr 2016 08:14 PM
for _,Meshes in pairs(KorbloxModel:GetChildren()) do


mybad



Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 08:15 PM
I have a Different package already in this server, but I want it to change when you click a screengui.



#code game.Workspace.YourMom.LastNight = true
Report Abuse
Service_Scripting is not online. Service_Scripting
Joined: 28 Mar 2013
Total Posts: 944
23 Apr 2016 08:17 PM
*TextButton



#code game.Workspace.YourMom.LastNight = true
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