我开始用roblox编程,我只为拥有gamepass的用户制作菜单,我想知道当用户拥有gamepass时,我如何才能生成一个排他的图形界面,而这里的错误是当用户购买gamepass时,会自动对服务器的所有用户激活专用界面,我想知道如何解决这个问题。
脚本在ServerScriptService上
local MarketPlaceService = game:GetService("MarketplaceService")
local GamePass = 100725261
local Tool = game.StarterGui.ScreenGui.TPMenu
fun
我一直在学习如何制作roblox游戏,但是最近我遇到了一个问题,就是代码是正确的,但是它不起作用。
我是按照这个做的。
但即使我做了类似的事情,它也不起作用。有人能纠正我哪里出问题了吗?
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local dona
我正在尝试制作一款游戏,允许玩家坐在特定的座位上,通过聊天他们的UserId或用户名来检查任何其他玩家的头像,但当用户输入用户名时,该函数总是返回Instance,这很烦人。但是,UserId可以正常工作。下面是我的代码: -- client-side script
local Players=game:GetService("Players")
local Player=Players.LocalPlayer
local GuiService=game:GetService("GuiService")
local Rep=game:GetService(
我正在尝试使用的按钮在StarterGUI中。不知道有没有帮助。这是一个脚本新手,但是我在另一篇文章中看到了类似的内容,并使用了该代码。下面是我在LocalScript中的代码: local MarketplaceService = game:GetService("MarketplaceService")
local player = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PurchaseE
我正在尝试设置postgresql,但每次我尝试创建一个表时: CREATE TABLE player (discord_id, game_id, game_username) 它什么也不做,没有错误。然后,当我使用\dt列出表格时,它会这样说: roblox=# \dt
Did not find any relations. 为什么我不能创建一个表?
我在roblox有一个gui商店,当我试着买东西的时候,它总是给我一个错误。我有模型的链接,所以你可以查看它并尝试解决问题。这就是出问题的代码 local price = script.Parent.Parent.Price
local tools = game.ReplicatedStorage:WaitForChild("Tools")
local tool = tools:FindFirstChild(script.Parent.Parent.ItemName.Value)
local player = script.Parent.Parent.Parent.Paren
我在卢阿没有太多经验,所以我是来寻求帮助的。我目前正在为一个名为ROBLOX的游戏编写脚本,但是我的脚本中遇到了一个问题,它来自这里的这个小部分。
me.Chatted:connect(function(msg)
if string.sub(msg,1,5) == "!kick" then
local PLAYER = (''.. string.sub(msg,6))
KICK('game.Players.PLAYER')
end
end)
(我得到的错误是:参数1丢失或零)
我有点不知所措,但这是
我有一个Lua脚本,它应该提示玩家购买游戏手柄,但它不起作用。它是在一个普通的脚本中。下面是代码和错误: local productId = 6657664
local donateButton = script.Parent
local function buy(player)
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, productId)
end
donateButton.ClickDetector.MouseClick:Connect(buy) Error her
hi最近在我的roblox游戏中为m4a1制作了一个视图模型,但是当我完成代码时,它没有工作。如果有人能发现错误,我会非常感激的:)
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService
当我在Roblox里面的时候,我正在写一个脚本,就像你之前写的一样: local amount = 123
local Module = require(game.ServerScriptService:WaitForChild("Module"))
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if player.leaderstats.Currency.Value >= amount then
player.leaderstats
一个关于Roblox studio的问题,或者更确切地说,是关于dataStore的问题。如果您在输出数据:GetCurrentPage()时按点将值直接保存在脚本中:GetCurrentPage()-此值将被输出,但如果您通过函数执行此操作,则会保存该值,但不会在数据:GetCurrentPage()中显示。如何保存用户数据? 将值直接保存在脚本中: PlayerPoints:SetAsync("Mars", 19)
local success, err = pcall(function()
local Data = PlayerPoints:GetSortedA
我阅读了Dev Hub上的数据存储V2文档,并尝试编写类似的代码,但无法使其正常工作。除了Attempt to index nil with Version之外,它没有任何其他错误,因为它无法获取数据。它返回KeyInfo = true和CurrentNumber,Succes = nil。保存数据时没有错误,Succes变量总是返回true。我启用了安全配置以允许数据存储,游戏是公开的,我在studio和实际游戏(在Roblox上)上对其进行了测试。代码位于服务器脚本服务的脚本中,代码如下: local DataStoreService = game:GetService('Dat
我想知道如何在Roblox中更改激活接近提示的leaderstat的播放器,但它不起作用。
这是我的脚本
script.Parent.ProximityPrompt.Triggered:Connect(function(Player)
if Player.Backpack:FindFirstChild("Card") or Player.Character:FindFirstChild("Card") then
--how do update my leaderstats--
else
print("
我正在尝试发布一个API。
这是我的代码:
function update(object){
var data = '<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd"
version=
我正在制作一个Roblox游戏,我需要以某种方式检测一个玩家的团队。我的代码目前看起来像这样: script.Parent.Touched:Connect(function(part)
local plr = part.Parent.Name
if (game.Players:FindFirstChild(plr).Team == "Police") then
....
end
end) 当我接触到那个部分(它是一面看不见的墙)时,它会给我一个错误: Workspace.Part.Script:3:尝试索引一个nil值 我做错了什么?
我试图从c#推出roblox,但似乎找不到roblox协议。
我尝试了我在windows运行中使用的代码,它确实找到了,但是一旦我用Process.Start来尝试它,它就说找不到这个文件。
public static string LaunchRoblox(string authTicket)
{
Random rnd = new Random();
long browserTrackerId = 55393295400 + rnd.Next(1, 100);
TimeSpan t = (DateTim
我有一个本地脚本,分配球衣给球员根据他们所在的球队。下面是脚本: 查看源代码 01 local player = game.Players.LocalPlayer
02
03 local char = player.Character or player.CharacterAdded:Wait()
04
05 local shirt
06
07 if player.Team == game.Teams["Red Team"] then
08 shirt = "http://www.roblox.com/asset?id=73022512
我试图使python与使用Firebase实时数据库进行数据存储不一致。在脚本开始时,我正在初始化应用程序,但是,当我试图创建一个引用时,我会得到错误The default Firebase app does not exist. Make sure to initialize the SDK by calling initialize_app()。我不知道我初始化后为什么会发生这种事?一些代码示例:
### I initialise the firebase app here?
# Variable def
client = commands.Bot(command_prefix="
当有人购买我的dev产品时,我希望他们得到一个可见的盾牌,持续30秒。
下面是我尝试过的代码:
local mpService = game:GetService("MarketplaceService")
local Debris = game:GetService("Debris")
local function giveForcefield(player, duration)
local character = player.Character
if character then
local forceField = In
所以当我定义变量的类型时,它是完全正确的:
local Player: Player = nil
但是,当我试图定义表中元素的类型时,它并不是我所认为的那样:
PlayerProfile.Player: Player = nil
Missed symbol `(`.Luau Syntax Check.(miss-symbol)
这是我第一次使用type,所以有人知道正确的方法吗?
这就是我要用的剧本。从这段YouTube视频中得到的:
。
我已经多次检查和尝试解决这个问题,找不到我的错误。
Roblox:
local RP = game:GetService("ReplicatedStorage")
local Combat = RP:WaitForChild("Combat")
local Animations = script:WaitForChild("Animations")
local anims =
(
Animations:WaitForChild("Right
正如标题所暗示的那样,我正试图通过按下键盘上的一个按钮来杀死我在roblox中的角色。我试过Humanoid.Health = 0和player.Character.Head:remove(),但它们都不起作用!我目前的解决方案是:
local UserInputService = game:GetService("UserInputService")
local resetStand = IsKeyDown(Enum.KeyCode.Semicolon)
if IsKeyDown(Enum.KeyCode.Semicolon) = true then
player
我正在学习javascript,目前只用javascript做了一个石头,纸,剪刀游戏。游戏将有1轮模式和3轮模式,但当我完成对1轮模式的编码时,我发现有问题显示结果,谁赢得了游戏它显示“游戏是平局”,找不到哪里有错误,有人能帮我吗? // Player choice
var getPlayerChoice = function() {
var playerChoice = prompt("Choose rock, paper, or scissors");
while (playerChoice !== 'rock' &&
脚本不起作用
我对脚本非常陌生,我只是在ROBLOX工作室里鬼鬼祟祟,我做了一个脚本,目的是将存储在ReplicatedStorage中的一个项目放入一个特定的StarterPack中,但是不管我做了什么,它都不想工作。有人能解释原因吗?
local playerName = "plr name"
local toolName = "tool name"
game.Players.PlayerAdded:Connect(function(player)
if player.Name == playerName then
local tool = game.R
我正在尝试在Roblox上做一个游戏,不久前我遇到了一个错误,我找不到修复方法,于是放弃了,然后我又开始尝试修复它。当我尝试检查玩家是否有能力购买该物品时,我得到的错误值不是玩家的有效成员,以下是错误的来源代码 game:GetService("ReplicatedStorage"):WaitForChild("Shop"):WaitForChild("UpgradeClicks").OnServerEvent:Connect(function(player, price)
if player.leaderstats.Views.Val
在开始之前,我将说控制台中没有任何类型的错误消息。不管怎么说,我一直在尝试制作一个用户工具游戏,玩家可以看到他们的化身,看起来像他们,等等。它过去在默认的Roblox聊天很好,但由于这是温和的,我做了一个“聊天室”为我的游戏。但是,现在只有其中一个函数工作(AvatarInspectMenu与一个UserId,而不是一个用户名)。看看你自己:
-- client script
local Players=game:GetService("Players")
local Player=Players.LocalPlayer
local StarterGui=game:GetSer
我一直在制作一个Roblox模拟器,作为一个辅助项目来学习如何制作游戏,现在我得到了一些帮助,你可以在下面看到,但它仍然没有工作。我在以下链接中有一些图片和视频:
目前,我的问题仍然是标题,我的问题和我的工具不起作用。我把它改成了远程事件,现在它不再改变我的领导地位了。我尝试过许多不同的解决方案,但都没有效果。我的第一个脚本是我的工具脚本。下面是:
local player = game.Players.LocalPlayer
script.Parent.Activated:Connect(function()
if player.Debounce.Value == false t
因此,我在网络上到处寻找一个脚本,这样当任何人加入我的Roblox游戏时,它都会在聊天中显示一条消息(例如:“玩家已加入我的游戏”)。这是我找到的最好的:
local Players = game:GetService("Players")
function onPlayerAdded((player)
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
Text = "Welcome to my game!";
我试图制作一个游戏,但它严重依赖于鼠标,但是会出现一个错误,即“尝试用‘Get老鼠’索引为零”,不管我做了什么,它都会产生这个错误。也许我的游戏没有更新(我想它已经更新了)。我以前也问过类似的问题,但现在我确信这是Roblox的错。
这是代码:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Block = game.ServerStorage.Experimental
function place()
PlacedBlock = Block:Clone()
Place
当我的排行榜试图更新时,我得到了这个错误。502: API服务拒绝了请求,但出现错误。排序的数据存储区类型的值格式无效。参数名称:值这是脚本: local CoinsDS = game:GetService("DataStoreService"):GetOrderedDataStore("MoneyLeaderboard")
local suffixes = {'','K','M','B','T','qd','Qn','sx',