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 5 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

01--make beast the beast
02 
03 
04game.Workspace.MapHolder.Facility.MapData.BeastSpawn.RemoteEvent.OnServerEvent:Connect(function(plr)
05    for _,player in pairs (contestants) do
06    if player == beast then
07        local model = game.Workspace.TheBeast
08        local character = player.Character
09        local newmodel = model:Clone()
10        character.Archivable = true;
11        player.Character = newmodel
12        character.Parent = nil
13    end
14end
15 
16end)
17 
18print("Beast made")

Local script attached to beast spawn

01function makebeast(plr)
02    wait(3)
03    local plr = plr.Parent
04    local camera = workspace.CurrentCamera
05    local rig = game.Workspace.TheBeast
06    camera.CameraType = "Follow"
07    camera.CameraSubject = rig.Head
08    game.Workspace.MapHolder.Facility.MapData.BeastSpawn.RemoteEvent:FireServer()
09end
10 
11 
12script.Parent.Touched:Connect(makebeast)
0
Is that your entire script? GeneratedScript 740 — 5y
0
I mean, that's not my entire game script no... but that is all that should matter. DevSpyChicken 8 — 5y

1 answer

Log in to vote
0
Answered by
Necro_las 412 Moderation Voter
5 years ago
Edited 5 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:

1...
2for _,player in pairs (contestants) do
3    print(player)
4    if player == beast then
5    print("the refference is working")
6    local model = game.Workspace.TheBeast
7...
Ad

Answer this question