Hello guys, while I was doing the new (Huge) update from Button Simulator, I had this issue.
Script:
local Player = game:GetService("Players")
task.wait()
script.Parent.Gui["Title (Required)"].Text = "You need at least "..script.Config["Required Value"].Value.." Ultra Rebirth."
local function touch()
game.Players.LocalPlayer.Character.Humanoid = script.Parent.Touched:Connect(function() -- This line errors.
if game.Players["Ultra Rebirth"].Value >= script.Config["Required Value"].Value then
game.Players.LocalPlayer.Character.PrimaryPart.CFrame = game.Workspace["Button Simulator"].Types["Tp THINGS"]["World 2"].TPPart.CFrame
elseif game.Players["Ultra Rebirth"].Value <= script.Config["Required Value"].Value then
warn("You do not have "..script.Config["Required Value"].Value.." Ultra Rebirth. Get "..script.Config["Required Value"].Value-game.Players.LocalPlayer.leaderstats["Ultra Rebirth"].Value.." Ultra Rebirth more !")
end
end)
end
return touch() -- This line also errors because it's a function that's starts at Line 6.
Video:
The issue appeared before the game starts.
And the video is broken⌠unfortunately.
Image:
Yeah, because it already says on the title, I donât need to put any images.
You can see of what it is.
local Player = game:GetService("Players")
local RunService = game:GetService("RunService")
task.wait()
script.Parent.Gui["Title (Required)"].Text = "You need at least "..script.Config["Required Value"].Value.." Ultra Rebirth."
local function touch()
if RunService:IsServer() then
return
end
game.Players.LocalPlayer.Character.Humanoid = script.Parent.Touched:Connect(function() -- This line errors.
if game.Players["Ultra Rebirth"].Value >= script.Config["Required Value"].Value then
game.Players.LocalPlayer.Character.PrimaryPart.CFrame = game.Workspace["Button Simulator"].Types["Tp THINGS"]["World 2"].TPPart.CFrame
elseif game.Players["Ultra Rebirth"].Value <= script.Config["Required Value"].Value then
warn("You do not have "..script.Config["Required Value"].Value.." Ultra Rebirth. Get "..script.Config["Required Value"].Value-game.Players.LocalPlayer.leaderstats["Ultra Rebirth"].Value.." Ultra Rebirth more !")
end
end)
end
return touch() -- This line also errors because it's a function that's starts at Line 6.
You can no longer use .character on the client side. Instead, use workspace:FindFirstChild(player.Name) to find the player in the workspace.
Also, instead of warning in the console log, you should show the player directly how many âUltra Rebirthsâ they need using a text-label or something.
That makes no sense, you can always use Character on the client.
This is what the error means. Itâs always a little confusing at first because you assume it means Character is nil, but it actually means the thing before it is nil.
I donât know. Recently, Roblox has been throwing errors at me whenever I try to use .character on the client, so the only way around it for me is to just get the character directly from the workspace.
Yeah, your script uses game.Players.LocalPlayer which you can only use in a local script or it will error. Also, what is the scriptâs parent? In your function you used script.Parent.Touched, but what is the script parented to?
This only happened at 60 FPS, but now, at about 240 FPS, the game loads.
local Player = game:GetService("Players")
task.wait()
script.Parent.Gui["Title (Required)"].Text = "You need at least "..script.Config["Required Value"].Value.." Ultra Rebirth."
local function touch()
game.Players:WaitForChild("Model").Humanoid = script.Parent.Touched:Connect(function()
if game.Players["Ultra Rebirth"].Value >= script.Config["Required Value"].Value then
game.Players:WaitForChild("Model").PrimaryPart.CFrame = game.Workspace["Button Simulator"].Types["Tp THINGS"]["World 2"].TPPart.CFrame
elseif game.Players["Ultra Rebirth"].Value <= script.Config["Required Value"].Value then
warn("You do not have "..script.Config["Required Value"].Value.." Ultra Rebirth. Get "..script.Config["Required Value"].Value-game.Players.LocalPlayer.leaderstats["Ultra Rebirth"].Value.." Ultra Rebirth more !")
end
end)
end
return touch()
local Player = game:GetService("Players")
task.wait()
script.Parent.Gui["Title (Required)"].Text = "You need at least "..script.Config["Required Value"].Value.." Ultra Rebirth."
local function touch(hit)
local plr = game.Players:GetPlayerFromCharacter(game.Players.LocalPlayer)
script.Parent.Touched:Connect(function()
if plr["Ultra Rebirth"].Value >= script.Config["Required Value"].Value then
game.Players:WaitForChild("Model").PrimaryPart.CFrame = game.Workspace["Button Simulator"].Types["Tp THINGS"]["World 2"].TPPart.CFrame
elseif game.Players["Ultra Rebirth"].Value <= script.Config["Required Value"].Value then
warn("You do not have "..script.Config["Required Value"].Value.." Ultra Rebirth. Get "..script.Config["Required Value"].Value-game.Players.LocalPlayer.leaderstats["Ultra Rebirth"].Value.." Ultra Rebirth more !")
end
end)
end
return touch()
local Player = game.Players.LocalPlayer
task.wait()
script.Parent.Gui["Title (Required)"].Text = "You need at least "..script.Config["Required Value"].Value.." Ultra Rebirth."
local function touch()
game.Players.LocalPlayer.Character.Humanoid = script.Parent.Touched:Connect(function() -- This line errors.
if game.Players["Ultra Rebirth"].Value >= script.Config["Required Value"].Value then
game.Players.LocalPlayer.Character.PrimaryPart.CFrame = game.Workspace["Button Simulator"].Types["Tp THINGS"]["World 2"].TPPart.CFrame
elseif game.Players["Ultra Rebirth"].Value <= script.Config["Required Value"].Value then
warn("You do not have "..script.Config["Required Value"].Value.." Ultra Rebirth. Get "..script.Config["Required Value"].Value-game.Players.LocalPlayer.leaderstats["Ultra Rebirth"].Value.." Ultra Rebirth more !")
end
end)
end
return touch()
local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = character:WaitForChild("Humanoid")
task.wait()
script.Parent.Gui["Title (Required)"].Text = "You need at least "..script.Config["Required Value"].Value.." Ultra Rebirth."
local function touch()
Humanoid = script.Parent.Touched:Connect(function()
if game.Players["Ultra Rebirth"].Value >= script.Config["Required Value"].Value then
character.PrimaryPart.CFrame = game.Workspace["Button Simulator"].Types["Tp THINGS"]["World 2"].TPPart.CFrame
elseif game.Players["Ultra Rebirth"].Value <= script.Config["Required Value"].Value then
warn("You do not have "..script.Config["Required Value"].Value.." Ultra Rebirth. Get "..script.Config["Required Value"].Value-game.Players.LocalPlayer.leaderstats["Ultra Rebirth"].Value.." Ultra Rebirth more !")
end
end)
end
return touch()
If that doesnât work, try this instead:
local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = character:WaitForChild("Humanoid")
task.wait()
script.Parent.Gui["Title (Required)"].Text = "You need at least "..script.Config["Required Value"].Value.." Ultra Rebirth."
local function touch()
script.Parent.Touched:Connect(function()
if game.Players["Ultra Rebirth"].Value >= script.Config["Required Value"].Value then
character.PrimaryPart.CFrame = game.Workspace["Button Simulator"].Types["Tp THINGS"]["World 2"].TPPart.CFrame
elseif game.Players["Ultra Rebirth"].Value <= script.Config["Required Value"].Value then
warn("You do not have "..script.Config["Required Value"].Value.." Ultra Rebirth. Get "..script.Config["Required Value"].Value-game.Players.LocalPlayer.leaderstats["Ultra Rebirth"].Value.." Ultra Rebirth more !")
end
end)
end
return touch()
Follow the steps below, and donât move your script to another location. There are 6 Steps, make sure you donât skip any of them.
Step1. Change your scriptâs RunContext to Client
This will turn your script into a local script.
Step2. Insert a RemoteFunction into ReplicatedStorage
Since the script is now a LocalScript, we will use a RemoteFunction to send data to the server.
Step3. Rename the RemoteFunction to âRemoteFunctionForPortalScriptâ
This will allow the RemoteFunction to be called in our LocalScript.
Step4. Add some script to your LocalScript
local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = character:WaitForChild("Humanoid")
task.wait()
script.Parent.Gui["Title (Required)"].Text = "You need at least "..script.Config["Required Value"].Value.." Ultra Rebirth."
local function touch()
script.Parent.Touched:Connect(function()
if game.Players["Ultra Rebirth"].Value >= script.Config["Required Value"].Value then
game.ReplicatedStorage.RemoteFunctionForPortalScript:InvokeServer()
elseif game.Players["Ultra Rebirth"].Value <= script.Config["Required Value"].Value then
warn("You do not have "..script.Config["Required Value"].Value.." Ultra Rebirth. Get "..script.Config["Required Value"].Value-game.Players.LocalPlayer.leaderstats["Ultra Rebirth"].Value.." Ultra Rebirth more !")
end
end)
end
return touch()
Paste this code into your LocalScript.
Step5. Add a Script into ServerScriptService
Step6. Add some script into your Script
game.ReplicatedStorage.RemoteFunctionForPortalScript.OnServerInvoke = function(player, part)
local character = player.Character or player.CharacterAdded:Wait()
character.PrimaryPart.CFrame = game.Workspace["Button Simulator"].Types["Tp THINGS"]["World 2"].TPPart.CFrame
end
local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = character:WaitForChild("Humanoid")
task.wait()
script.Parent.Gui["Title (Required)"].Text = "You need at least "..script.Config["Required Value"].Value.." Ultra Rebirth."
local function touch()
script.Parent.Touched:Connect(function()
if game.Players["Ultra Rebirth"].Value >= script.Config["Required Value"].Value then
game.ReplicatedStorage.RemoteFunctionForPortalScript:InvokeServer()
elseif game.Players["Ultra Rebirth"].Value <= script.Config["Required Value"].Value then
warn("You do not have "..script.Config["Required Value"].Value.." Ultra Rebirth. Get "..script.Config["Required Value"].Value-game.Players.LocalPlayer.leaderstats["Ultra Rebirth"].Value.." Ultra Rebirth more !")
end
end)
end
return touch()
local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = character:WaitForChild("Humanoid")
task.wait()
script.Parent.Gui["Title (Required)"].Text = "You need at least "..script.Config["Required Value"].Value.." Ultra Rebirth."
local function touch()
script.Parent.Touched:Connect(function()
if game.Players["Ultra Rebirth"].Value >= script.Config["Required Value"].Value then
game.ReplicatedStorage.RemoteFunctionForPortalScript:InvokeServer()
elseif game.Players["Ultra Rebirth"].Value <= script.Config["Required Value"].Value then
warn("You do not have "..script.Config["Required Value"].Value.." Ultra Rebirth. Get "..script.Config["Required Value"].Value-game.Players.LocalPlayer.leaderstats["Ultra Rebirth"].Value.." Ultra Rebirth more !")
end
end)
end
return touch
bruh the () on the end, Return the function not fire the function, anyways its fixed