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

Generated Script, my character changing script isn't working?

Asked by 4 years ago

I heeded your advice and made a remote event and localscript on my "beast" spawn that, ontouched, will fire a remote event in the main script to transform the character. Nothing seems to be happening. I am getting the "Beast made" message at the end of my script though. Thanks for the help!

Main Script

--make beast the beast


game.Workspace.MapHolder.Facility.MapData.BeastSpawn.RemoteEvent.OnServerEvent:Connect(function(plr)
    for _,player in pairs (contestants) do
    if player == beast then
        local model = game.Workspace.TheBeast
        local character = player.Character
        local newmodel = model:Clone()
        character.Archivable = true;
        player.Character = newmodel
        character.Parent = nil
    end
end

end)

print("Beast made")

Local script attached to beast spawn

function makebeast(plr)
    wait(3)
    local plr = plr.Parent
    local camera = workspace.CurrentCamera
    local rig = game.Workspace.TheBeast
    camera.CameraType = "Follow"
    camera.CameraSubject = rig.Head
    game.Workspace.MapHolder.Facility.MapData.BeastSpawn.RemoteEvent:FireServer()
end


script.Parent.Touched:Connect(makebeast)
0
Is that your entire script? GeneratedScript 740 — 4y
0
I mean, that's not my entire game script no... but that is all that should matter. DevSpyChicken 8 — 4y

1 answer

Log in to vote
0
Answered by
Necro_las 412 Moderation Voter
4 years ago
Edited 4 years ago

As far as I know, RemoteEvent's have to be stored in ReplicatedStorage, maybe the Local Script cant reach that in workspace.

Try checking that "player" reference using this on line 05:

...
for _,player in pairs (contestants) do
    print(player)
    if player == beast then
    print("the refference is working")
    local model = game.Workspace.TheBeast
...
Ad

Answer this question