I’m trying to make it so when you say “Change” in the chat it will change you’re startercharacter but I’ve a few things and it’s still not working.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg == "Change" then
-- I'm not sure what to put here
end
end)
end)
local PlayersService = game:GetService("Players");
local StringToDetect = ("Changed")
PlayersService.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message)
if string.find(string.lower(Message), string.lower(StringToDetect)) then
-- do something
end;
end;
end);
end);
server script: put this thing in serverscriptservice
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg == "Change" then
-- change the players startercharacter on the server here
end
end)
end)
I want to change the startercharacter i’m using right now in the starterplayer folder. I tried to do game.StarterPlayer.StarterCharcter2.Name = StarterCharacter But that does not work.
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local davidvenin2015Variable = game.Lighting.davidvenin2015
local NormalStarterCharacter = game.StarterPlayer.StarterCharacter
game.Players.PlayerAdded:Connect(function(player) -- runs every time a player joins
player.Chatted:Connect(function(msg) -- runs once the player that joined chats a message
if msg == "davidvenin2015" then -- create your conditions
davidvenin2015Variable.Name = "StarterCharacter"
NormalStarterCharacter.Name = "NormalCharacter"
davidvenin2015Variable.Parent = game.StarterPlayer
NormalStarterCharacter.Parent = game.Lighting
end
end)
end)
But the player has to reset for the startercharacter to change, do you know how to work round this?
Oh, I just tested it with another person and if they reset they become that startercharacter to. Do you know how to make it so it’s just the player who says the word, who’s startercharcater changes.