|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 23 Apr 2016 05:42 PM |
Whoops.. v:Clone().Parent = p.Character |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
| |
|
| |
|
| |
|
| |
|
|
| 23 Apr 2016 07:29 PM |
bump
#code game.Workspace.YourMom.LastNight = true |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 23 Apr 2016 07:32 PM |
oop sorry
i was looking at the outdated one |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 15 Jun 2013 |
| Total Posts: 9746 |
|
|
| 23 Apr 2016 08:14 PM |
for _,Meshes in pairs(KorbloxModel:GetChildren()) do
mybad
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 23 Apr 2016 08:17 PM |
*TextButton
#code game.Workspace.YourMom.LastNight = true |
|
|
| Report Abuse |
|
|