Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isnt my dinosaur gui morph button working?

Asked by
ndlego 0
6 years ago

I was working on a script for a dinosaur morph gui button and the script doesnt work. any errors? The gui works fine but the button does nothing when i click it. The button has this script 1st and the model second as its children. Does the order matter?

Trex=script.Parent Trex01=Trex.Parent:findFirstChild("Trex01") clone=Trex01:clone()

function Clicked(click) if click.Parent == nil then return end newClone = clone:Clone() newClone.Parent = workspace newClone:MakeJoints() game.Players[click.Parent.name].Character = newClone end

button.MouseButton1Down:connect(click)

Trex is the button and Trex01 is the morph model

Im a noob scripter so plz dont get mad :D its proly a small stupid error anyway.

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago
  1. Place Trex01 in Lighting

  2. Trex01 must be a model

  3. Trex01 must have a Humanoid and a Head.

For the rest I can don't answer you sorry, but the script have to work

local player = game.Players.LocalPlayer

local button = script.Parent.button

local Trex01 = game.Lighting:FindFirstChild("Trex01") 
local clone = Trex01:clone()

function Clicked()
    local newClone = clone:Clone() 
    newClone.Parent = workspace
    newClone:MakeJoints()
    player.Character = newClone
    workspace.CurrentCamera.CameraSubject = player.Character.Humanoid
end

button.MouseButton1Down:connect(Clicked)

put in LocalScript

Ad

Answer this question