Remote event help

Im making a script where when the player says the command they grow bigger

The issue is whenever i fire the remote event from a local script it doesn’t work and im trying to figure out why .

Ive tried using tables instead on the server script but that didnt go well either .

server script

ts = game:GetService("TweenService")

goal1 = {}
goal1.Transparency = 1

goal2 = {}
goal2.Transparency = 0

tweenInfo = TweenInfo.new(1)

game.ReplicatedStorage.Big.OnClientEvent:Connect(function(Player, Character)

game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		
		local Humanoid = Character:WaitForChild("Humanoid")
		local face = Character.Head.face
		Player.Chatted:Connect(function(msg)
				
				for _,v in pairs(Character:GetDescendants()) do
					if (v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal")) then
						if v.Name ~= "HumanoidRootPart" then 
							ts:Create(v, tweenInfo, {Transparency = 1}):Play()
						end
					end
				end
				

				wait(0.3)

				local HS = Humanoid.HeadScale
				local BDS = Humanoid.BodyDepthScale
				local BWS = Humanoid.BodyWidthScale
				local BHS = Humanoid.BodyHeightScale


				wait(0.3)

				HS.Value =  HS.Value * 3
				BDS.Value = BDS.Value * 3
				BWS.Value = BWS.Value * 3
				BHS.Value = BHS.Value * 3


				for _,v in pairs(Character:GetDescendants()) do
					if (v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal")) then
						if v.Name ~= "HumanoidRootPart" then 
							ts:Create(v, tweenInfo, {Transparency = 0}):Play()
						end
					end
				end

				Humanoid.WalkSpeed = 19
				

				wait(15)


				for _,v in pairs(Character:GetDescendants()) do
					if (v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal")) then
						if v.Name ~= "HumanoidRootPart" then 
							ts:Create(v, tweenInfo, {Transparency = 1}):Play()
						end
					end
				end

				wait(0.6)

				HS.Value =  HS.Value / 3
				BDS.Value = BDS.Value / 3
				BWS.Value = BWS.Value / 3
				BHS.Value = BHS.Value / 3

				Humanoid.WalkSpeed = 16


				for _,v in pairs(Character:GetDescendants()) do
					if (v:IsA("BasePart") or v:IsA("MeshPart") or v:IsA("Decal")) then
						if v.Name ~= "HumanoidRootPart" then 
								ts:Create(v, tweenInfo, {Transparency = 0}):Play()
								
							end
							
						
						end
						
					
					end
				
				end)
				
			
			end)
			
		
		end)
	
	end)

local script

local db = false
local remote = game.ReplicatedStorage.Big
game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)

		local Humanoid = Character:WaitForChild("Humanoid")
		local face = Character.Head.face
		Player.Chatted:Connect(function(msg)

			if string.lower(msg) == "maior" and not db then
				db = true 
				
				remote:FireAllClients()
			end
			
			wait(14)
			
			db = false
		end)
	end)
end)
1 Like

game.ReplicatedStorage.Big.OnClientEvent:Connect(function(Player, Character) Use WaitForChild() and you should be using .OnServerEvent, not .OnClientEvent

It should not be fire all clients instead you should do RemoteEvent:FireServer()
On the Server script:
RemoteEvent.OnServerEvent:Connect(function(player)–the player who clicked
– code what you want it to do
end)
You can get the character of that player by doing player.Character or
repeat wait() until player.Character
this means it will keep looping until the character is loaded in and not break the script further or there is also a event

Not really sure what you’re doing here… You don’t need to be making a new chatted connection every time a player respawns, you don’t really need PlayerAdded or CharacterAdded in the LocalScript either, and you can’t use FireAllClients() on the client.

It could be as simple as this:

Server Script

game.Players.PlayerAdded:Connect(function(Player)
	local db = false
	local Character, Humanoid, Face
	Player.CharacterAdded:Connect(function(NewCharacter)
		db = false
		Character = NewCharacter
		Humanoid = Character:WaitForChild("Humanoid")
		Face = Character.Head.face
	end)
	
	Player.Chatted:Connect(function(msg)
		if not db and string.lower(msg) == "maior" then
			db = true
			local HS = Humanoid.HeadScale
			local BDS = Humanoid.BodyDepthScale
			local BWS = Humanoid.BodyWidthScale
			local BHS = Humanoid.BodyHeightScale

			HS.Value *= 3
			BDS.Value *= 3
			BWS.Value *= 3
			BHS.Value *= 3

			Humanoid.WalkSpeed = 19


			wait(3)

			HS.Value /= 3
			BDS.Value /= 3
			BWS.Value /= 3
			BHS.Value /= 3

			Humanoid.WalkSpeed = 16
			db = false
		end
	end)
end)

use :FireServer() instead of Fireall

remote:FireServer(Character)