Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

2 comments

0

Is that your entire script?

0

I mean, that's not my entire game script no... but that is all that should matter.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.